2001-06-09 04:45:59 +08:00
|
|
|
#ifndef H_RPMCLI
|
|
|
|
#define H_RPMCLI
|
|
|
|
|
|
|
|
/** \ingroup rpmcli rpmbuild
|
|
|
|
* \file lib/rpmcli.h
|
|
|
|
*/
|
|
|
|
|
2001-06-18 06:18:03 +08:00
|
|
|
#include "rpmlib.h"
|
|
|
|
#include "rpmurl.h"
|
|
|
|
#include "rpmmacro.h"
|
2004-10-25 03:36:30 +08:00
|
|
|
#include "argv.h"
|
2007-08-30 20:49:31 +08:00
|
|
|
#include "idtx.h"
|
2001-06-09 04:45:59 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Should version 3 packages be produced?
|
|
|
|
*/
|
2002-06-23 02:51:56 +08:00
|
|
|
/*@-redecl@*/
|
2002-06-20 02:52:46 +08:00
|
|
|
/*@unchecked@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
extern int _noDirTokens;
|
2002-06-23 02:51:56 +08:00
|
|
|
/*@=redecl@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2002-07-01 06:47:32 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Popt option table for options shared by all modes and executables.
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct poptOption rpmcliAllPoptTable[];
|
|
|
|
|
2004-10-25 23:26:51 +08:00
|
|
|
/*@unchecked@*/
|
|
|
|
extern int ftsOpts;
|
|
|
|
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct poptOption rpmcliFtsPoptTable[];
|
|
|
|
|
2002-07-28 08:41:15 +08:00
|
|
|
/*@unchecked@*/ /*@observer@*/ /*@null@*/
|
|
|
|
extern const char * rpmcliPipeOutput;
|
|
|
|
|
|
|
|
/*@unchecked@*/ /*@observer@*/ /*@null@*/
|
|
|
|
extern const char * rpmcliRcfile;
|
|
|
|
|
|
|
|
/*@unchecked@*/ /*@observer@*/ /*@null@*/
|
|
|
|
extern const char * rpmcliRootDir;
|
|
|
|
|
2002-07-01 06:47:32 +08:00
|
|
|
/**
|
|
|
|
* Initialize most everything needed by an rpm CLI executable context.
|
|
|
|
* @param argc no. of args
|
|
|
|
* @param argv arg array
|
|
|
|
* @param optionsTable popt option table
|
|
|
|
* @return popt context (or NULL)
|
|
|
|
*/
|
|
|
|
/*@null@*/
|
|
|
|
poptContext
|
|
|
|
rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmCLIMacroContext, rpmGlobalMacroContext, h_errno, stderr,
|
2002-07-02 21:16:50 +08:00
|
|
|
fileSystem, internalState @*/
|
|
|
|
/*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, stderr,
|
|
|
|
fileSystem, internalState @*/;
|
2002-07-01 06:47:32 +08:00
|
|
|
|
2002-07-28 08:41:15 +08:00
|
|
|
/**
|
|
|
|
* Make sure that rpm configuration has been read.
|
|
|
|
* @warning Options like --rcfile and --verbose must precede callers option.
|
|
|
|
*/
|
|
|
|
/*@mayexit@*/
|
|
|
|
void rpmcliConfigured(void)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmCLIMacroContext, rpmGlobalMacroContext, h_errno,
|
2002-07-28 08:41:15 +08:00
|
|
|
fileSystem, internalState @*/
|
|
|
|
/*@modifies rpmCLIMacroContext, rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
2002-07-01 06:47:32 +08:00
|
|
|
/**
|
|
|
|
* Destroy most everything needed by an rpm CLI executable context.
|
|
|
|
* @param optCon popt context
|
|
|
|
* @return NULL always
|
|
|
|
*/
|
|
|
|
poptContext
|
|
|
|
rpmcliFini(/*@only@*/ /*@null@*/ poptContext optCon)
|
|
|
|
/*@modifies optCon @*/;
|
|
|
|
|
2002-07-28 08:41:15 +08:00
|
|
|
/**
|
|
|
|
* Common/global popt tokens used for command line option tables.
|
|
|
|
*/
|
|
|
|
#define RPMCLI_POPT_NODEPS -1025
|
|
|
|
#define RPMCLI_POPT_FORCE -1026
|
|
|
|
#define RPMCLI_POPT_NOMD5 -1027
|
|
|
|
#define RPMCLI_POPT_NOSCRIPTS -1028
|
|
|
|
#define RPMCLI_POPT_NOSIGNATURE -1029
|
|
|
|
#define RPMCLI_POPT_NODIGEST -1030
|
|
|
|
#define RPMCLI_POPT_NOHDRCHK -1031
|
2003-12-26 07:00:44 +08:00
|
|
|
#define RPMCLI_POPT_NOCONTEXTS -1032
|
2002-07-28 08:41:15 +08:00
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/* ==================================================================== */
|
|
|
|
/** \name RPMQV */
|
|
|
|
/*@{*/
|
|
|
|
|
2001-10-25 09:36:32 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Query/Verify argument qualifiers.
|
|
|
|
* @todo Reassign to tag values.
|
|
|
|
*/
|
|
|
|
typedef enum rpmQVSources_e {
|
|
|
|
RPMQV_PACKAGE = 0, /*!< ... from package name db search. */
|
|
|
|
RPMQV_PATH, /*!< ... from file path db search. */
|
|
|
|
RPMQV_ALL, /*!< ... from each installed package. */
|
|
|
|
RPMQV_RPM, /*!< ... from reading binary rpm package. */
|
|
|
|
RPMQV_GROUP, /*!< ... from group db search. */
|
|
|
|
RPMQV_WHATPROVIDES, /*!< ... from provides db search. */
|
|
|
|
RPMQV_WHATREQUIRES, /*!< ... from requires db search. */
|
|
|
|
RPMQV_TRIGGEREDBY, /*!< ... from trigger db search. */
|
|
|
|
RPMQV_DBOFFSET, /*!< ... from database header instance. */
|
2002-02-05 07:29:59 +08:00
|
|
|
RPMQV_SPECFILE, /*!< ... from spec file parse (query only). */
|
|
|
|
RPMQV_PKGID, /*!< ... from package id (header+payload MD5). */
|
|
|
|
RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */
|
|
|
|
RPMQV_FILEID, /*!< ... from file id (file MD5). */
|
2004-10-25 09:10:13 +08:00
|
|
|
RPMQV_TID, /*!< ... from install transaction id (time stamp). */
|
|
|
|
RPMQV_HDLIST, /*!< ... from system hdlist. */
|
|
|
|
RPMQV_FTSWALK /*!< ... from fts(3) walk. */
|
2001-10-25 09:36:32 +08:00
|
|
|
} rpmQVSources;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Bit(s) for rpmVerifyFile() attributes and result.
|
|
|
|
*/
|
|
|
|
typedef enum rpmVerifyAttrs_e {
|
|
|
|
RPMVERIFY_NONE = 0, /*!< */
|
|
|
|
RPMVERIFY_MD5 = (1 << 0), /*!< from %verify(md5) */
|
|
|
|
RPMVERIFY_FILESIZE = (1 << 1), /*!< from %verify(size) */
|
|
|
|
RPMVERIFY_LINKTO = (1 << 2), /*!< from %verify(link) */
|
|
|
|
RPMVERIFY_USER = (1 << 3), /*!< from %verify(user) */
|
|
|
|
RPMVERIFY_GROUP = (1 << 4), /*!< from %verify(group) */
|
|
|
|
RPMVERIFY_MTIME = (1 << 5), /*!< from %verify(mtime) */
|
|
|
|
RPMVERIFY_MODE = (1 << 6), /*!< from %verify(mode) */
|
|
|
|
RPMVERIFY_RDEV = (1 << 7), /*!< from %verify(rdev) */
|
2003-12-26 03:02:01 +08:00
|
|
|
/* bits 8-14 unused, reserved for rpmVerifyAttrs */
|
|
|
|
RPMVERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */
|
|
|
|
/* bits 16-22 used in rpmVerifyFlags */
|
2001-10-25 09:36:32 +08:00
|
|
|
/* bits 23-27 used in rpmQueryFlags */
|
2003-12-26 03:02:01 +08:00
|
|
|
RPMVERIFY_READLINKFAIL= (1 << 28), /*!< readlink failed */
|
|
|
|
RPMVERIFY_READFAIL = (1 << 29), /*!< file read failed */
|
|
|
|
RPMVERIFY_LSTATFAIL = (1 << 30), /*!< lstat failed */
|
|
|
|
RPMVERIFY_LGETFILECONFAIL = (1 << 31) /*!< lgetfilecon failed */
|
2001-10-25 09:36:32 +08:00
|
|
|
} rpmVerifyAttrs;
|
|
|
|
#define RPMVERIFY_ALL ~(RPMVERIFY_NONE)
|
2003-12-26 03:02:01 +08:00
|
|
|
#define RPMVERIFY_FAILURES \
|
|
|
|
(RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL|RPMVERIFY_LGETFILECONFAIL)
|
2001-10-25 09:36:32 +08:00
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Bit(s) to control rpmQuery() operation, stored in qva_flags.
|
2001-06-13 01:06:47 +08:00
|
|
|
* @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?.
|
2001-06-09 04:45:59 +08:00
|
|
|
*/
|
|
|
|
typedef enum rpmQueryFlags_e {
|
2001-06-12 12:10:21 +08:00
|
|
|
/*@-enummemuse@*/
|
2002-03-11 03:00:31 +08:00
|
|
|
QUERY_FOR_DEFAULT = 0, /*!< */
|
2001-06-13 01:06:47 +08:00
|
|
|
QUERY_MD5 = (1 << 0), /*!< from --nomd5 */
|
|
|
|
QUERY_SIZE = (1 << 1), /*!< from --nosize */
|
|
|
|
QUERY_LINKTO = (1 << 2), /*!< from --nolink */
|
|
|
|
QUERY_USER = (1 << 3), /*!< from --nouser) */
|
|
|
|
QUERY_GROUP = (1 << 4), /*!< from --nogroup) */
|
|
|
|
QUERY_MTIME = (1 << 5), /*!< from --nomtime) */
|
|
|
|
QUERY_MODE = (1 << 6), /*!< from --nomode) */
|
|
|
|
QUERY_RDEV = (1 << 7), /*!< from --nodev */
|
2003-12-26 03:02:01 +08:00
|
|
|
/* bits 8-14 unused, reserved for rpmVerifyAttrs */
|
|
|
|
QUERY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */
|
2001-06-13 01:06:47 +08:00
|
|
|
QUERY_FILES = (1 << 16), /*!< verify: from --nofiles */
|
|
|
|
QUERY_DEPS = (1 << 17), /*!< verify: from --nodeps */
|
|
|
|
QUERY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */
|
|
|
|
QUERY_DIGEST = (1 << 19), /*!< verify: from --nodigest */
|
2001-10-25 09:36:32 +08:00
|
|
|
QUERY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */
|
2003-12-26 03:02:01 +08:00
|
|
|
QUERY_PATCHES = (1 << 21), /*!< verify: from --nopatches */
|
2002-07-25 00:21:23 +08:00
|
|
|
QUERY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */
|
2001-06-12 12:10:21 +08:00
|
|
|
/*@=enummemuse@*/
|
2001-06-13 01:06:47 +08:00
|
|
|
QUERY_FOR_LIST = (1 << 23), /*!< query: from --list */
|
|
|
|
QUERY_FOR_STATE = (1 << 24), /*!< query: from --state */
|
|
|
|
QUERY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */
|
|
|
|
QUERY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
|
2001-12-21 00:28:46 +08:00
|
|
|
QUERY_FOR_DUMPFILES = (1 << 27) /*!< query: from --dump */
|
2001-06-09 04:45:59 +08:00
|
|
|
} rpmQueryFlags;
|
|
|
|
|
2002-03-09 06:24:58 +08:00
|
|
|
#define _QUERY_FOR_BITS \
|
|
|
|
(QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
|
|
|
|
QUERY_FOR_DUMPFILES)
|
|
|
|
|
2002-07-28 08:41:15 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Bit(s) from common command line options.
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern rpmQueryFlags rpmcliQueryFlags;
|
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Bit(s) to control rpmVerify() operation, stored in qva_flags.
|
2001-06-13 01:06:47 +08:00
|
|
|
* @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs values?.
|
2001-06-09 04:45:59 +08:00
|
|
|
*/
|
|
|
|
typedef enum rpmVerifyFlags_e {
|
2001-06-12 12:10:21 +08:00
|
|
|
/*@-enummemuse@*/
|
2001-06-13 01:06:47 +08:00
|
|
|
VERIFY_DEFAULT = 0, /*!< */
|
2001-06-12 12:10:21 +08:00
|
|
|
/*@=enummemuse@*/
|
2001-06-13 01:06:47 +08:00
|
|
|
VERIFY_MD5 = (1 << 0), /*!< from --nomd5 */
|
|
|
|
VERIFY_SIZE = (1 << 1), /*!< from --nosize */
|
|
|
|
VERIFY_LINKTO = (1 << 2), /*!< from --nolinkto */
|
|
|
|
VERIFY_USER = (1 << 3), /*!< from --nouser */
|
|
|
|
VERIFY_GROUP = (1 << 4), /*!< from --nogroup */
|
|
|
|
VERIFY_MTIME = (1 << 5), /*!< from --nomtime */
|
|
|
|
VERIFY_MODE = (1 << 6), /*!< from --nomode */
|
|
|
|
VERIFY_RDEV = (1 << 7), /*!< from --nodev */
|
2003-12-26 03:02:01 +08:00
|
|
|
/* bits 8-14 unused, reserved for rpmVerifyAttrs */
|
|
|
|
VERIFY_CONTEXTS = (1 << 15), /*!< verify: from --nocontexts */
|
2001-06-13 01:06:47 +08:00
|
|
|
VERIFY_FILES = (1 << 16), /*!< verify: from --nofiles */
|
|
|
|
VERIFY_DEPS = (1 << 17), /*!< verify: from --nodeps */
|
|
|
|
VERIFY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */
|
|
|
|
VERIFY_DIGEST = (1 << 19), /*!< verify: from --nodigest */
|
2001-10-25 09:36:32 +08:00
|
|
|
VERIFY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */
|
2003-12-26 03:02:01 +08:00
|
|
|
VERIFY_PATCHES = (1 << 21), /*!< verify: from --nopatches */
|
2002-07-25 00:21:23 +08:00
|
|
|
VERIFY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */
|
2001-06-13 01:06:47 +08:00
|
|
|
/*@-enummemuse@*/
|
|
|
|
VERIFY_FOR_LIST = (1 << 23), /*!< query: from --list */
|
|
|
|
VERIFY_FOR_STATE = (1 << 24), /*!< query: from --state */
|
|
|
|
VERIFY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */
|
|
|
|
VERIFY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
|
2001-12-21 00:28:46 +08:00
|
|
|
VERIFY_FOR_DUMPFILES= (1 << 27) /*!< query: from --dump */
|
2001-06-13 01:06:47 +08:00
|
|
|
/*@=enummemuse@*/
|
2003-12-26 03:02:01 +08:00
|
|
|
/* bits 28-31 used in rpmVerifyAttrs */
|
2001-06-09 04:45:59 +08:00
|
|
|
} rpmVerifyFlags;
|
2001-06-13 01:06:47 +08:00
|
|
|
|
|
|
|
#define VERIFY_ATTRS \
|
|
|
|
( VERIFY_MD5 | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GROUP | \
|
2003-12-26 03:02:01 +08:00
|
|
|
VERIFY_MTIME | VERIFY_MODE | VERIFY_RDEV | VERIFY_CONTEXTS )
|
2001-06-12 12:10:21 +08:00
|
|
|
#define VERIFY_ALL \
|
2001-10-25 09:36:32 +08:00
|
|
|
( VERIFY_ATTRS | VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT | VERIFY_DIGEST |\
|
2002-07-25 00:21:23 +08:00
|
|
|
VERIFY_SIGNATURE | VERIFY_HDRCHK )
|
2001-10-25 09:36:32 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
typedef struct rpmQVKArguments_s * QVA_t;
|
2001-06-09 04:45:59 +08:00
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
2001-10-25 09:36:32 +08:00
|
|
|
* Function to display iterator matches.
|
|
|
|
*
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param h header to use for query/verify
|
2002-12-22 04:37:37 +08:00
|
|
|
* @return 0 on success
|
2001-06-12 12:10:21 +08:00
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals fileSystem @*/
|
2001-10-24 21:48:55 +08:00
|
|
|
/*@modifies qva, ts, fileSystem @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
2002-12-22 10:11:05 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Function to query spec file.
|
|
|
|
*
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param qva parsed query/verify options
|
|
|
|
* @param arg query argument
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
|
|
|
typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno,
|
2002-12-22 10:11:05 +08:00
|
|
|
fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, qva, rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
2001-10-25 09:36:32 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Describe query/verify/signature command line operation.
|
|
|
|
*/
|
|
|
|
struct rpmQVKArguments_s {
|
|
|
|
rpmQVSources qva_source; /*!< Identify CLI arg type. */
|
|
|
|
int qva_sourceCount;/*!< Exclusive option check (>1 is error). */
|
|
|
|
rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */
|
|
|
|
rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
rpmdbMatchIterator qva_mi; /*!< Match iterator on selected headers. */
|
2005-01-05 01:11:00 +08:00
|
|
|
/*@refccounted@*/ /*@relnull@*/
|
2004-10-25 03:36:30 +08:00
|
|
|
rpmgi qva_gi; /*!< Generalized iterator on args. */
|
|
|
|
rpmRC qva_rc; /*!< Current return code. */
|
|
|
|
|
2001-10-25 09:36:32 +08:00
|
|
|
/*@null@*/
|
|
|
|
QVF_t qva_showPackage; /*!< Function to display iterator matches. */
|
2002-12-22 10:11:05 +08:00
|
|
|
/*@null@*/
|
|
|
|
QSpecF_t qva_specQuery; /*!< Function to query spec file. */
|
2002-01-28 23:51:06 +08:00
|
|
|
/*@unused@*/
|
|
|
|
int qva_verbose; /*!< (unused) */
|
2001-10-25 09:36:32 +08:00
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
const char * qva_queryFormat;/*!< Format for headerSprintf(). */
|
|
|
|
int sign; /*!< Is a passphrase needed? */
|
|
|
|
/*@observer@*/
|
|
|
|
const char * passPhrase; /*!< Pass phrase. */
|
|
|
|
/*@observer@*/ /*@null@*/
|
|
|
|
const char * qva_prefix; /*!< Path to top of install tree. */
|
|
|
|
char qva_mode;
|
|
|
|
/*!<
|
|
|
|
- 'q' from --query, -q
|
|
|
|
- 'Q' from --querytags
|
|
|
|
- 'V' from --verify, -V
|
|
|
|
- 'A' from --addsign
|
|
|
|
- 'I' from --import
|
|
|
|
- 'K' from --checksig, -K
|
|
|
|
- 'R' from --resign
|
|
|
|
*/
|
|
|
|
char qva_char; /*!< (unused) always ' ' */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct rpmQVKArguments_s rpmQVKArgs;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct poptOption rpmQVSourcePoptTable[];
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern int specedit;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct poptOption rpmQueryPoptTable[];
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct poptOption rpmVerifyPoptTable[];
|
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Display query/verify information for each header in iterator.
|
2001-10-24 21:48:55 +08:00
|
|
|
*
|
|
|
|
* This routine uses:
|
|
|
|
* - qva->qva_mi rpm database iterator
|
|
|
|
* - qva->qva_showPackage query/verify display routine
|
|
|
|
*
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @return result of last non-zero showPackage() return
|
|
|
|
*/
|
2002-08-09 00:06:13 +08:00
|
|
|
int rpmcliShowMatches(QVA_t qva, rpmts ts)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
2002-09-17 23:21:03 +08:00
|
|
|
/*@modifies qva, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Display list of tags that can be used in --queryformat.
|
|
|
|
* @param fp file handle to use for display
|
|
|
|
*/
|
|
|
|
void rpmDisplayQueryTags(FILE * fp)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals fileSystem @*/
|
2001-06-12 12:10:21 +08:00
|
|
|
/*@modifies *fp, fileSystem @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Common query/verify source interface, called once for each CLI arg.
|
2001-10-24 21:48:55 +08:00
|
|
|
*
|
|
|
|
* This routine uses:
|
|
|
|
* - qva->qva_mi rpm database iterator
|
|
|
|
* - qva->qva_showPackage query/verify display routine
|
|
|
|
*
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param arg name of source to query/verify
|
|
|
|
* @return showPackage() result, 1 if rpmdbInitIterator() is NULL
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno,
|
2001-10-15 11:22:10 +08:00
|
|
|
fileSystem, internalState @*/
|
2001-10-24 21:48:55 +08:00
|
|
|
/*@modifies qva, ts, rpmGlobalMacroContext,
|
2001-10-18 00:43:36 +08:00
|
|
|
fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Display results of package query.
|
|
|
|
* @todo Devise a meaningful return code.
|
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param h header to use for query
|
|
|
|
* @return 0 always
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
|
2003-11-24 03:50:52 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
2004-10-25 03:36:30 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Iterate over query/verify arg list.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param qva parsed query/verify options
|
|
|
|
* @param argv query argument(s) (or NULL)
|
|
|
|
* @return 0 on success, else no. of failures
|
|
|
|
*/
|
|
|
|
int rpmcliArgIter(rpmts ts, QVA_t qva, /*@null@*/ ARGV_t argv)
|
2004-10-26 08:22:10 +08:00
|
|
|
/*@globals ftsOpts, rpmGlobalMacroContext, h_errno,
|
2004-10-25 03:36:30 +08:00
|
|
|
fileSystem, internalState @*/
|
2004-10-26 08:22:10 +08:00
|
|
|
/*@modifies ts, qva, ftsOpts, rpmGlobalMacroContext,
|
2004-10-25 03:36:30 +08:00
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Display package information.
|
2001-06-14 04:57:06 +08:00
|
|
|
* @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union?
|
2001-10-28 06:31:10 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param argv query argument(s) (or NULL)
|
|
|
|
* @return 0 on success, else no. of failures
|
2001-06-12 12:10:21 +08:00
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmcliQuery(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno,
|
2001-10-15 11:22:10 +08:00
|
|
|
fileSystem, internalState @*/
|
2001-10-28 06:31:10 +08:00
|
|
|
/*@modifies ts, qva, rpmGlobalMacroContext,
|
2001-10-18 00:43:36 +08:00
|
|
|
fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
2001-10-25 09:36:32 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Verify file attributes (including MD5 sum).
|
|
|
|
* @todo gnorpm and python bindings prevent this from being static.
|
2002-03-13 00:56:17 +08:00
|
|
|
* @param ts transaction set
|
|
|
|
* @param fi file info (with linked header and current file index)
|
2002-12-22 04:37:37 +08:00
|
|
|
* @retval *res bit(s) returned to indicate failure
|
2001-10-25 09:36:32 +08:00
|
|
|
* @param omitMask bit(s) to disable verify checks
|
|
|
|
* @return 0 on success (or not installed), 1 on error
|
|
|
|
*/
|
2002-07-03 22:01:49 +08:00
|
|
|
/*@-incondefs@*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmVerifyFile(const rpmts ts, rpmfi fi,
|
2002-07-03 22:01:49 +08:00
|
|
|
/*@out@*/ rpmVerifyAttrs * res, rpmVerifyAttrs omitMask)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals h_errno, fileSystem, internalState @*/
|
2003-12-26 07:00:44 +08:00
|
|
|
/*@modifies ts, fi, *res, fileSystem, internalState @*/
|
2002-07-03 22:01:49 +08:00
|
|
|
/*@requires maxSet(res) >= 0 @*/;
|
|
|
|
/*@=incondefs@*/
|
2001-10-25 09:36:32 +08:00
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Display results of package verify.
|
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param h header to use for verify
|
|
|
|
* @return result of last non-zero verify return
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
2002-03-13 00:56:17 +08:00
|
|
|
/*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
2001-10-25 09:36:32 +08:00
|
|
|
/**
|
|
|
|
* Check package and header signatures.
|
|
|
|
* @param qva parsed query/verify options
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param fd package file handle
|
|
|
|
* @param fn package file name
|
|
|
|
* @return 0 on success, 1 on failure
|
|
|
|
*/
|
2002-07-03 22:01:49 +08:00
|
|
|
int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
|
|
|
/*@modifies qva, ts, fd, rpmGlobalMacroContext, h_errno,
|
2001-10-25 09:36:32 +08:00
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Verify package install.
|
2001-10-24 21:48:55 +08:00
|
|
|
* @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union?
|
2001-10-28 06:31:10 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param qva parsed query/verify options
|
2001-10-24 21:48:55 +08:00
|
|
|
* @param argv verify argument(s) (or NULL)
|
|
|
|
* @return 0 on success, else no. of failures
|
2001-06-12 12:10:21 +08:00
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmcliVerify(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno,
|
2001-10-15 11:22:10 +08:00
|
|
|
fileSystem, internalState @*/
|
2001-10-28 06:31:10 +08:00
|
|
|
/*@modifies ts, qva, rpmGlobalMacroContext,
|
2001-10-18 00:43:36 +08:00
|
|
|
fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
2002-07-28 22:52:33 +08:00
|
|
|
/*@}*/
|
|
|
|
/* ==================================================================== */
|
|
|
|
/** \name RPMBT */
|
|
|
|
/*@{*/
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Describe build command line request.
|
|
|
|
*/
|
|
|
|
struct rpmBuildArguments_s {
|
|
|
|
rpmQueryFlags qva_flags; /*!< Bit(s) to control verification. */
|
|
|
|
int buildAmount; /*!< Bit(s) to control operation. */
|
|
|
|
/*@null@*/
|
|
|
|
const char * buildRootOverride; /*!< from --buildroot */
|
|
|
|
/*@null@*/
|
|
|
|
char * targets; /*!< Target platform(s), comma separated. */
|
|
|
|
/*@observer@*/
|
|
|
|
const char * passPhrase; /*!< Pass phrase. */
|
|
|
|
/*@only@*/ /*@null@*/
|
|
|
|
const char * cookie; /*!< NULL for binary, ??? for source, rpm's */
|
|
|
|
int force; /*!< from --force */
|
|
|
|
int noBuild; /*!< from --nobuild */
|
|
|
|
int noDeps; /*!< from --nodeps */
|
|
|
|
int noLang; /*!< from --nolang */
|
|
|
|
int shortCircuit; /*!< from --short-circuit */
|
|
|
|
int sign; /*!< from --sign */
|
|
|
|
int useCatalog; /*!< from --usecatalog */
|
|
|
|
char buildMode; /*!< Build mode (one of "btBC") */
|
|
|
|
char buildChar; /*!< Build stage (one of "abcilps ") */
|
|
|
|
/*@observer@*/ /*@null@*/
|
|
|
|
const char * rootdir;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
typedef struct rpmBuildArguments_s * BTA_t;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct rpmBuildArguments_s rpmBTArgs;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern struct poptOption rpmBuildPoptTable[];
|
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/*@}*/
|
|
|
|
/* ==================================================================== */
|
|
|
|
/** \name RPMEIU */
|
|
|
|
/*@{*/
|
|
|
|
/* --- install/upgrade/erase modes */
|
|
|
|
|
2001-10-18 00:43:36 +08:00
|
|
|
/*@unchecked@*/
|
2002-08-05 00:55:55 +08:00
|
|
|
extern int rpmcliPackagesTotal;
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern int rpmcliHashesCurrent;
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern int rpmcliHashesTotal;
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern int rpmcliProgressCurrent;
|
|
|
|
/*@unchecked@*/
|
|
|
|
extern int rpmcliProgressTotal;
|
2001-10-18 00:43:36 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
2002-08-05 00:55:55 +08:00
|
|
|
* The rpm CLI generic transaction callback handler.
|
|
|
|
* @todo Remove headerSprintf() from the progress callback.
|
2001-10-18 00:43:36 +08:00
|
|
|
* @deprecated Transaction callback arguments need to change, so don't rely on
|
|
|
|
* this routine in the rpmcli API.
|
|
|
|
*
|
|
|
|
* @param arg per-callback private data (e.g. an rpm header)
|
|
|
|
* @param what callback identifier
|
|
|
|
* @param amount per-callback progress info
|
|
|
|
* @param total per-callback progress info
|
2002-04-09 02:56:01 +08:00
|
|
|
* @param key opaque header key (e.g. file name or PyObject)
|
2001-10-18 00:43:36 +08:00
|
|
|
* @param data private data (e.g. rpmInstallInterfaceFlags)
|
|
|
|
* @return per-callback data (e.g. an opened FD_t)
|
|
|
|
*/
|
2002-12-22 04:37:37 +08:00
|
|
|
/*@null@*/
|
|
|
|
void * rpmShowProgress(/*@null@*/ const void * arg,
|
2001-10-18 00:43:36 +08:00
|
|
|
const rpmCallbackType what,
|
|
|
|
const unsigned long amount,
|
|
|
|
const unsigned long total,
|
2001-11-08 08:12:49 +08:00
|
|
|
/*@null@*/ fnpyKey key,
|
2001-10-18 00:43:36 +08:00
|
|
|
/*@null@*/ void * data)
|
2002-08-05 00:55:55 +08:00
|
|
|
/*@globals rpmcliHashesCurrent,
|
|
|
|
rpmcliProgressCurrent, rpmcliProgressTotal,
|
2003-05-09 04:39:29 +08:00
|
|
|
h_errno, fileSystem, internalState @*/
|
2002-08-05 00:55:55 +08:00
|
|
|
/*@modifies rpmcliHashesCurrent,
|
|
|
|
rpmcliProgressCurrent, rpmcliProgressTotal,
|
|
|
|
fileSystem, internalState @*/;
|
2001-10-18 00:43:36 +08:00
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Install source rpm package.
|
2001-10-26 12:16:19 +08:00
|
|
|
* @param ts transaction set
|
2001-06-12 12:10:21 +08:00
|
|
|
* @param arg source rpm file name
|
2002-12-22 04:37:37 +08:00
|
|
|
* @retval *specFilePtr (installed) spec file name
|
|
|
|
* @retval *cookie
|
2001-06-12 12:10:21 +08:00
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmInstallSource(rpmts ts, const char * arg,
|
2002-04-12 00:55:19 +08:00
|
|
|
/*@null@*/ /*@out@*/ const char ** specFilePtr,
|
2001-10-24 00:48:20 +08:00
|
|
|
/*@null@*/ /*@out@*/ const char ** cookie)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno,
|
2001-10-18 00:43:36 +08:00
|
|
|
fileSystem, internalState@*/
|
2002-04-12 00:55:19 +08:00
|
|
|
/*@modifies ts, *specFilePtr, *cookie, rpmGlobalMacroContext,
|
2001-10-18 00:43:36 +08:00
|
|
|
fileSystem, internalState @*/;
|
2001-06-12 12:10:21 +08:00
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Describe database command line requests.
|
|
|
|
*/
|
|
|
|
struct rpmInstallArguments_s {
|
2002-05-20 07:37:24 +08:00
|
|
|
rpmtransFlags transFlags;
|
2001-06-09 04:45:59 +08:00
|
|
|
rpmprobFilterFlags probFilter;
|
|
|
|
rpmInstallInterfaceFlags installInterfaceFlags;
|
|
|
|
rpmEraseInterfaceFlags eraseInterfaceFlags;
|
2002-07-28 08:41:15 +08:00
|
|
|
rpmQueryFlags qva_flags; /*!< from --nodigest/--nosignature */
|
|
|
|
uint_32 rbtid; /*!< from --rollback */
|
2001-06-09 04:45:59 +08:00
|
|
|
int numRelocations;
|
|
|
|
int noDeps;
|
|
|
|
int incldocs;
|
2002-07-28 08:41:15 +08:00
|
|
|
/*@owned@*/ /*@null@*/
|
|
|
|
rpmRelocation * relocations;
|
2002-01-28 23:51:06 +08:00
|
|
|
/*@null@*/
|
|
|
|
const char * prefix;
|
|
|
|
/*@observer@*/ /*@null@*/
|
|
|
|
const char * rootdir;
|
2001-06-09 04:45:59 +08:00
|
|
|
};
|
|
|
|
|
2002-03-13 23:06:07 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Install/upgrade/freshen binary rpm package.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param ia mode flags and parameters
|
|
|
|
* @param fileArgv array of package file names (NULL terminated)
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia,
|
2002-03-13 23:06:07 +08:00
|
|
|
/*@null@*/ const char ** fileArgv)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno,
|
2002-03-13 23:06:07 +08:00
|
|
|
fileSystem, internalState@*/
|
2002-08-09 00:06:13 +08:00
|
|
|
/*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
|
2002-03-13 23:06:07 +08:00
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Erase binary rpm package.
|
|
|
|
* @param ts transaction set
|
2002-04-09 02:56:01 +08:00
|
|
|
* @param ia control args/bits
|
2002-03-13 23:06:07 +08:00
|
|
|
* @param argv array of package file names (NULL terminated)
|
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2007-08-30 20:49:31 +08:00
|
|
|
|
2002-10-10 03:07:43 +08:00
|
|
|
int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia,
|
2002-03-13 23:06:07 +08:00
|
|
|
/*@null@*/ const char ** argv)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
|
2002-09-17 23:21:03 +08:00
|
|
|
/*@modifies ts, ia, rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState @*/;
|
2002-03-13 23:06:07 +08:00
|
|
|
|
2001-07-07 04:37:42 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Rollback transactions, erasing new, reinstalling old, package(s).
|
2001-10-28 06:31:10 +08:00
|
|
|
* @param ts transaction set
|
2002-03-13 04:28:30 +08:00
|
|
|
* @param ia mode flags and parameters
|
|
|
|
* @param argv array of arguments (NULL terminated)
|
2001-07-07 04:37:42 +08:00
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia,
|
2001-07-07 04:37:42 +08:00
|
|
|
/*@null@*/ const char ** argv)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno,
|
2002-08-09 00:06:13 +08:00
|
|
|
fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState @*/;
|
2001-07-07 04:37:42 +08:00
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
2001-10-15 11:22:10 +08:00
|
|
|
/*@unchecked@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
extern struct rpmInstallArguments_s rpmIArgs;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
2001-10-15 11:22:10 +08:00
|
|
|
/*@unchecked@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
extern struct poptOption rpmInstallPoptTable[];
|
|
|
|
|
|
|
|
/*@}*/
|
|
|
|
/* ==================================================================== */
|
|
|
|
/** \name RPMDB */
|
|
|
|
/*@{*/
|
|
|
|
/* --- database modes */
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Describe database command line requests.
|
|
|
|
*/
|
|
|
|
struct rpmDatabaseArguments_s {
|
|
|
|
int init; /*!< from --initdb */
|
|
|
|
int rebuild; /*!< from --rebuilddb */
|
|
|
|
int verify; /*!< from --verifydb */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
2001-10-15 11:22:10 +08:00
|
|
|
/*@unchecked@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
extern struct rpmDatabaseArguments_s rpmDBArgs;
|
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
2001-10-15 11:22:10 +08:00
|
|
|
/*@unchecked@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
extern struct poptOption rpmDatabasePoptTable[];
|
|
|
|
|
|
|
|
/*@}*/
|
|
|
|
/* ==================================================================== */
|
|
|
|
/** \name RPMK */
|
|
|
|
/*@{*/
|
|
|
|
|
2002-08-07 03:07:37 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Import public key packet(s).
|
|
|
|
* @todo Implicit --update policy for gpg-pubkey headers.
|
|
|
|
* @param ts transaction set
|
|
|
|
* @param pkt pgp pubkey packet(s)
|
|
|
|
* @param pktlen pgp pubkey length
|
2003-04-22 06:31:28 +08:00
|
|
|
* @return RPMRC_OK/RPMRC_FAIL
|
2002-08-07 03:07:37 +08:00
|
|
|
*/
|
2003-04-22 06:31:28 +08:00
|
|
|
rpmRC rpmcliImportPubkey(const rpmts ts,
|
2002-08-07 03:07:37 +08:00
|
|
|
const unsigned char * pkt, ssize_t pktlen)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals RPMVERSION, rpmGlobalMacroContext, h_errno,
|
2002-08-07 03:07:37 +08:00
|
|
|
fileSystem, internalState @*/
|
|
|
|
/*@modifies ts, rpmGlobalMacroContext,
|
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
2001-06-12 12:10:21 +08:00
|
|
|
/** \ingroup rpmcli
|
|
|
|
* Bit(s) to control rpmReSign() operation.
|
|
|
|
*/
|
2001-10-25 09:36:32 +08:00
|
|
|
/*@-typeuse@*/
|
2001-10-24 00:48:20 +08:00
|
|
|
typedef enum rpmSignFlags_e {
|
|
|
|
RPMSIGN_NONE = 0,
|
2001-10-25 09:36:32 +08:00
|
|
|
RPMSIGN_CHK_SIGNATURE = 'K', /*!< from --checksig */
|
|
|
|
RPMSIGN_NEW_SIGNATURE = 'R', /*!< from --resign */
|
|
|
|
RPMSIGN_ADD_SIGNATURE = 'A', /*!< from --addsign */
|
2004-11-10 08:50:41 +08:00
|
|
|
RPMSIGN_DEL_SIGNATURE = 'D', /*!< from --delsign */
|
2001-10-25 09:36:32 +08:00
|
|
|
RPMSIGN_IMPORT_PUBKEY = 'I', /*!< from --import */
|
2001-10-24 00:48:20 +08:00
|
|
|
} rpmSignFlags;
|
2001-10-25 09:36:32 +08:00
|
|
|
/*@=typeuse@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
|
|
|
|
/** \ingroup rpmcli
|
|
|
|
*/
|
2001-10-15 11:22:10 +08:00
|
|
|
/*@unchecked@*/
|
2001-06-09 04:45:59 +08:00
|
|
|
extern struct poptOption rpmSignPoptTable[];
|
|
|
|
|
2001-10-24 00:48:20 +08:00
|
|
|
/** \ingroup rpmcli
|
2001-10-24 04:52:51 +08:00
|
|
|
* Create/Modify/Check elements from signature header.
|
2002-03-13 04:28:30 +08:00
|
|
|
* @param ts transaction set
|
2001-10-25 09:36:32 +08:00
|
|
|
* @param qva mode flags and parameters
|
2002-03-13 04:28:30 +08:00
|
|
|
* @param argv array of arguments (NULL terminated)
|
2001-10-24 00:48:20 +08:00
|
|
|
* @return 0 on success
|
|
|
|
*/
|
2002-05-20 02:42:25 +08:00
|
|
|
int rpmcliSign(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
|
2003-05-09 04:39:29 +08:00
|
|
|
/*@globals RPMVERSION, rpmGlobalMacroContext, h_errno,
|
2001-10-24 00:48:20 +08:00
|
|
|
fileSystem, internalState @*/
|
2002-03-13 04:28:30 +08:00
|
|
|
/*@modifies ts, qva, rpmGlobalMacroContext,
|
2001-10-24 00:48:20 +08:00
|
|
|
fileSystem, internalState @*/;
|
|
|
|
|
2001-06-09 04:45:59 +08:00
|
|
|
/*@}*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* H_RPMCLI */
|