rpmcli.h
Go to the documentation of this file.
#ifndef H_RPMCLI
#define H_RPMCLI
#include <popt.h>
#include <rpm/rpmlib.h>
#include <rpm/rpmurl.h>
#include <rpm/rpmmacro.h>
#include <rpm/rpmcallback.h>
#include <rpm/rpmts.h>
#include <rpm/rpmfi.h>
#include <rpm/argv.h>
#ifdef __cplusplus
extern "C" {
#endif
extern struct poptOption rpmcliAllPoptTable[];
extern const char * rpmcliPipeOutput;
extern const char * rpmcliRcfile;
extern const char * rpmcliRootDir;
poptContext
rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable);
void rpmcliConfigured(void);
poptContext
rpmcliFini(poptContext optCon);
#define RPMCLI_POPT_NODEPS -1025
#define RPMCLI_POPT_FORCE -1026
#define RPMCLI_POPT_NOMD5 -1027
#define RPMCLI_POPT_NOFILEDIGEST -1027 /* same as obsolete RPMCLI_POPT_NOMD5 */
#define RPMCLI_POPT_NOSCRIPTS -1028
#define RPMCLI_POPT_NOSIGNATURE -1029
#define RPMCLI_POPT_NODIGEST -1030
#define RPMCLI_POPT_NOHDRCHK -1031
#define RPMCLI_POPT_NOCONTEXTS -1032
#define RPMCLI_POPT_NOCAPS -1033
#define RPMCLI_POPT_TARGETPLATFORM -1034
/* ==================================================================== */
enum rpmQVSources_e {
RPMQV_PACKAGE = 0,
RPMQV_PATH,
RPMQV_ALL,
RPMQV_RPM,
RPMQV_GROUP,
RPMQV_WHATPROVIDES,
RPMQV_WHATREQUIRES,
RPMQV_TRIGGEREDBY,
RPMQV_DBOFFSET,
RPMQV_SPECRPMS,
RPMQV_SPECFILE = RPMQV_SPECRPMS,
RPMQV_PKGID,
RPMQV_HDRID,
RPMQV_TID,
RPMQV_SPECSRPM,
RPMQV_WHATRECOMMENDS,
RPMQV_WHATSUGGESTS,
RPMQV_WHATSUPPLEMENTS,
RPMQV_WHATENHANCES,
RPMQV_SPECBUILTRPMS,
RPMQV_WHATOBSOLETES,
RPMQV_WHATCONFLICTS,
};
typedef rpmFlags rpmQVSources;
enum rpmQueryFlags_e {
QUERY_FOR_DEFAULT = 0,
/* bits 0-14 unused */
/* bits 15-18 reserved for rpmVerifyFlags */
/* bits 19-21 unused */
QUERY_FOR_LIST = (1 << 23),
QUERY_FOR_STATE = (1 << 24),
/* bits 25-26 unused */
QUERY_FOR_DUMPFILES = (1 << 27),
};
typedef rpmFlags rpmQueryFlags;
#define _QUERY_FOR_BITS \
(QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DUMPFILES)
extern rpmQueryFlags rpmcliQueryFlags;
extern rpmVSFlags rpmcliVSFlags;
extern int rpmcliVfyLevelMask;
typedef struct rpmQVKArguments_s * QVA_t;
typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h);
typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg);
struct rpmQVKArguments_s {
rpmQVSources qva_source;
int qva_sourceCount;
rpmQueryFlags qva_flags;
rpmfileAttrs qva_incattr;
rpmfileAttrs qva_excattr;
rpmVerifyAttrs qva_ofvattr;
QVF_t qva_showPackage;
QSpecF_t qva_specQuery;
char * qva_queryFormat;
char qva_mode;
};
extern struct rpmQVKArguments_s rpmQVKArgs;
extern struct poptOption rpmQVSourcePoptTable[];
extern struct poptOption rpmQVFilePoptTable[];
extern struct poptOption rpmQueryPoptTable[];
extern struct poptOption rpmVerifyPoptTable[];
void rpmDisplayQueryTags(FILE * fp);
int showQueryPackage(QVA_t qva, rpmts ts, Header h);
int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv);
int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv);
int showVerifyPackage(QVA_t qva, rpmts ts, Header h);
int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn);
enum rpmVerifyFlags_e {
VERIFY_DEFAULT = 0,
/* bits 1-14 unused */
VERIFY_CONTEXTS = (1 << 15),
VERIFY_FILES = (1 << 16),
VERIFY_DEPS = (1 << 17),
VERIFY_SCRIPT = (1 << 18),
};
typedef rpmFlags rpmVerifyFlags;
#define VERIFY_ALL \
( VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT )
int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv);
/* ==================================================================== */
/* --- install/upgrade/erase modes */
enum rpmInstallFlags_e {
INSTALL_NONE = 0,
INSTALL_PERCENT = (1 << 0),
INSTALL_HASH = (1 << 1),
INSTALL_NODEPS = (1 << 2),
INSTALL_NOORDER = (1 << 3),
INSTALL_LABEL = (1 << 4),
INSTALL_UPGRADE = (1 << 5),
INSTALL_FRESHEN = (1 << 6),
INSTALL_INSTALL = (1 << 7),
INSTALL_ERASE = (1 << 8),
INSTALL_ALLMATCHES = (1 << 9),
INSTALL_REINSTALL = (1 << 10),
};
typedef rpmFlags rpmInstallFlags;
#define UNINSTALL_NONE INSTALL_NONE
#define UNINSTALL_NODEPS INSTALL_NODEPS
#define UNINSTALL_ALLMATCHES INSTALL_ALLMATCHES
void * rpmShowProgress(const void * arg,
const rpmCallbackType what,
const rpm_loff_t amount,
const rpm_loff_t total,
fnpyKey key,
void * data);
int rpmInstallSource(rpmts ts, const char * arg,
char ** specFilePtr,
char ** cookie);
struct rpmInstallArguments_s {
rpmtransFlags transFlags;
rpmprobFilterFlags probFilter;
rpmInstallFlags installInterfaceFlags;
int numRelocations;
int noDeps;
int incldocs;
rpmRelocation * relocations;
char * prefix;
};
int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv);
int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
extern struct rpmInstallArguments_s rpmIArgs;
extern struct poptOption rpmInstallPoptTable[];
/* ==================================================================== */
int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv);
int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv);
#ifdef __cplusplus
}
#endif
#endif /* H_RPMCLI */
rpmVerifyPoptTable
struct poptOption rpmVerifyPoptTable[]
rpmts
struct rpmts_s * rpmts
Definition: rpmtypes.h:63
RPMQV_RPM
@ RPMQV_RPM
Definition: rpmcli.h:85
rpmcliQuery
int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv)
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
rpmQVSources
rpmFlags rpmQVSources
Definition: rpmcli.h:106
rpmQVSources_e
rpmQVSources_e
Definition: rpmcli.h:81
QSpecF_t
int(* QSpecF_t)(rpmts ts, QVA_t qva, const char *arg)
Definition: rpmcli.h:159
rpmInstallFlags_e
rpmInstallFlags_e
Definition: rpmcli.h:294
RPMQV_WHATCONFLICTS
@ RPMQV_WHATCONFLICTS
Definition: rpmcli.h:103
rpmInstallArguments_s::probFilter
rpmprobFilterFlags probFilter
Definition: rpmcli.h:357
RPMQV_PATH
@ RPMQV_PATH
Definition: rpmcli.h:83
rpmInstallArguments_s::numRelocations
int numRelocations
Definition: rpmcli.h:359
rpmInstallPoptTable
struct poptOption rpmInstallPoptTable[]
RPMQV_SPECSRPM
@ RPMQV_SPECSRPM
Definition: rpmcli.h:96
rpmcliArgIter
int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv)
RPMQV_ALL
@ RPMQV_ALL
Definition: rpmcli.h:84
rpmcliVSFlags
rpmVSFlags rpmcliVSFlags
ARGV_const_t
char *const * ARGV_const_t
Definition: argv.h:18
RPMQV_GROUP
@ RPMQV_GROUP
Definition: rpmcli.h:86
rpmQVKArguments_s::qva_queryFormat
char * qva_queryFormat
Definition: rpmcli.h:175
QUERY_FOR_DEFAULT
@ QUERY_FOR_DEFAULT
Definition: rpmcli.h:113
rpmcliImportPubkeys
int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv)
Import public key(s) to rpm keyring.
VERIFY_FILES
@ VERIFY_FILES
Definition: rpmcli.h:267
RPMQV_SPECFILE
@ RPMQV_SPECFILE
Definition: rpmcli.h:92
INSTALL_PERCENT
@ INSTALL_PERCENT
Definition: rpmcli.h:296
rpmVerifyFlags_e
rpmVerifyFlags_e
Definition: rpmcli.h:263
RPMQV_SPECRPMS
@ RPMQV_SPECRPMS
Definition: rpmcli.h:91
rpmErase
int rpmErase(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
QUERY_FOR_STATE
@ QUERY_FOR_STATE
Definition: rpmcli.h:118
QUERY_FOR_DUMPFILES
@ QUERY_FOR_DUMPFILES
Definition: rpmcli.h:120
rpmInstallArguments_s::relocations
rpmRelocation * relocations
Definition: rpmcli.h:362
rpmcliQueryFlags
rpmQueryFlags rpmcliQueryFlags
rpmQVKArguments_s::qva_ofvattr
rpmVerifyAttrs qva_ofvattr
Definition: rpmcli.h:171
rpmcliPipeOutput
const char * rpmcliPipeOutput
INSTALL_HASH
@ INSTALL_HASH
Definition: rpmcli.h:297
rpmInstallSource
int rpmInstallSource(rpmts ts, const char *arg, char **specFilePtr, char **cookie)
RPMQV_TID
@ RPMQV_TID
Definition: rpmcli.h:95
rpmprobFilterFlags
rpmFlags rpmprobFilterFlags
Definition: rpmprob.h:35
rpmQVKArguments_s::qva_sourceCount
int qva_sourceCount
Definition: rpmcli.h:166
RPMQV_WHATOBSOLETES
@ RPMQV_WHATOBSOLETES
Definition: rpmcli.h:102
VERIFY_DEPS
@ VERIFY_DEPS
Definition: rpmcli.h:268
rpmtransFlags
rpmFlags rpmtransFlags
Definition: rpmts.h:60
rpmVerifyAttrs
rpmFlags rpmVerifyAttrs
Definition: rpmfiles.h:95
rpmcliInit
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
showVerifyPackage
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
rpmcliConfigured
void rpmcliConfigured(void)
RPMQV_WHATREQUIRES
@ RPMQV_WHATREQUIRES
Definition: rpmcli.h:88
rpmInstallArguments_s
Definition: rpmcli.h:355
rpmQVKArguments_s
Definition: rpmcli.h:164
INSTALL_REINSTALL
@ INSTALL_REINSTALL
Definition: rpmcli.h:306
ARGV_t
char ** ARGV_t
Definition: argv.h:17
rpmInstallArguments_s::transFlags
rpmtransFlags transFlags
Definition: rpmcli.h:356
INSTALL_ALLMATCHES
@ INSTALL_ALLMATCHES
Definition: rpmcli.h:305
rpmQVKArguments_s::qva_source
rpmQVSources qva_source
Definition: rpmcli.h:165
rpmDisplayQueryTags
void rpmDisplayQueryTags(FILE *fp)
rpmcliRootDir
const char * rpmcliRootDir
rpmQueryFlags_e
rpmQueryFlags_e
Definition: rpmcli.h:112
rpmIArgs
struct rpmInstallArguments_s rpmIArgs
RPMQV_WHATSUGGESTS
@ RPMQV_WHATSUGGESTS
Definition: rpmcli.h:98
showQueryPackage
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
rpmQVKArguments_s::qva_showPackage
QVF_t qva_showPackage
Definition: rpmcli.h:173
INSTALL_NOORDER
@ INSTALL_NOORDER
Definition: rpmcli.h:299
rpmInstallArguments_s::installInterfaceFlags
rpmInstallFlags installInterfaceFlags
Definition: rpmcli.h:358
VERIFY_SCRIPT
@ VERIFY_SCRIPT
Definition: rpmcli.h:269
rpmCallbackType
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
rpmQueryPoptTable
struct poptOption rpmQueryPoptTable[]
rpmInstallFlags
rpmFlags rpmInstallFlags
Definition: rpmcli.h:309
rpmQVSourcePoptTable
struct poptOption rpmQVSourcePoptTable[]
QVA_t
struct rpmQVKArguments_s * QVA_t
Definition: rpmcli.h:139
RPMQV_WHATRECOMMENDS
@ RPMQV_WHATRECOMMENDS
Definition: rpmcli.h:97
RPMQV_WHATPROVIDES
@ RPMQV_WHATPROVIDES
Definition: rpmcli.h:87
rpmcliAllPoptTable
struct poptOption rpmcliAllPoptTable[]
rpmInstallArguments_s::noDeps
int noDeps
Definition: rpmcli.h:360
RPMQV_TRIGGEREDBY
@ RPMQV_TRIGGEREDBY
Definition: rpmcli.h:89
RPMQV_HDRID
@ RPMQV_HDRID
Definition: rpmcli.h:94
rpmInstall
int rpmInstall(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_t fileArgv)
QVF_t
int(* QVF_t)(QVA_t qva, rpmts ts, Header h)
Definition: rpmcli.h:149
QUERY_FOR_LIST
@ QUERY_FOR_LIST
Definition: rpmcli.h:117
rpm_loff_t
uint64_t rpm_loff_t
Definition: rpmtypes.h:51
VERIFY_DEFAULT
@ VERIFY_DEFAULT
Definition: rpmcli.h:264
RPMQV_WHATSUPPLEMENTS
@ RPMQV_WHATSUPPLEMENTS
Definition: rpmcli.h:99
INSTALL_NODEPS
@ INSTALL_NODEPS
Definition: rpmcli.h:298
rpmRelocation_s
We pass these around as an array with a sentinel.
Definition: rpmfiles.h:127
INSTALL_INSTALL
@ INSTALL_INSTALL
Definition: rpmcli.h:303
rpmcliVfyLevelMask
int rpmcliVfyLevelMask
rpmQVKArguments_s::qva_flags
rpmQueryFlags qva_flags
Definition: rpmcli.h:167
fnpyKey
const void * fnpyKey
Definition: rpmtypes.h:76
RPMQV_PKGID
@ RPMQV_PKGID
Definition: rpmcli.h:93
FD_t
struct _FD_s * FD_t
Definition: rpmtypes.h:99
rpmQVKArgs
struct rpmQVKArguments_s rpmQVKArgs
rpmQVKArguments_s::qva_incattr
rpmfileAttrs qva_incattr
Definition: rpmcli.h:168
INSTALL_FRESHEN
@ INSTALL_FRESHEN
Definition: rpmcli.h:302
rpmVerifyFlags
rpmFlags rpmVerifyFlags
Definition: rpmcli.h:272
rpmQVKArguments_s::qva_mode
char qva_mode
Definition: rpmcli.h:176
rpmQVKArguments_s::qva_excattr
rpmfileAttrs qva_excattr
Definition: rpmcli.h:169
rpmInstallArguments_s::prefix
char * prefix
Definition: rpmcli.h:363
rpmShowProgress
void * rpmShowProgress(const void *arg, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, void *data)
RPMQV_SPECBUILTRPMS
@ RPMQV_SPECBUILTRPMS
Definition: rpmcli.h:101
INSTALL_UPGRADE
@ INSTALL_UPGRADE
Definition: rpmcli.h:301
rpmcliVerify
int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv)
RPMQV_DBOFFSET
@ RPMQV_DBOFFSET
Definition: rpmcli.h:90
INSTALL_LABEL
@ INSTALL_LABEL
Definition: rpmcli.h:300
INSTALL_ERASE
@ INSTALL_ERASE
Definition: rpmcli.h:304
RPMQV_WHATENHANCES
@ RPMQV_WHATENHANCES
Definition: rpmcli.h:100
RPMQV_PACKAGE
@ RPMQV_PACKAGE
Definition: rpmcli.h:82
rpmVSFlags
rpmFlags rpmVSFlags
Definition: rpmts.h:112
Header
struct headerToken_s * Header
Definition: rpmtypes.h:24
VERIFY_CONTEXTS
@ VERIFY_CONTEXTS
Definition: rpmcli.h:266
rpmfileAttrs
rpmFlags rpmfileAttrs
Definition: rpmfiles.h:65
rpmVerifySignatures
int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char *fn)
Check package and header signatures.
rpmInstallArguments_s::incldocs
int incldocs
Definition: rpmcli.h:361
INSTALL_NONE
@ INSTALL_NONE
Definition: rpmcli.h:295
rpmQVFilePoptTable
struct poptOption rpmQVFilePoptTable[]
rpmcliFini
poptContext rpmcliFini(poptContext optCon)
rpmQueryFlags
rpmFlags rpmQueryFlags
Definition: rpmcli.h:123
rpmcliRcfile
const char * rpmcliRcfile
rpmcliVerifySignatures
int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv)
rpmQVKArguments_s::qva_specQuery
QSpecF_t qva_specQuery
Definition: rpmcli.h:174