Loading...
Searching...
No Matches
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,
RPMQV_PATH_ALL,
};
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),
INSTALL_RESTORE = (1 << 11),
};
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);
int rpmRestore(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 */
argv.h
rpmcliVerifySignatures
int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv)
rpmShowProgress
void * rpmShowProgress(const void *arg, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, void *data)
rpmInstall
int rpmInstall(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_t fileArgv)
rpmcliQuery
int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv)
QVF_t
int(* QVF_t)(QVA_t qva, rpmts ts, Header h)
Definition rpmcli.h:150
rpmcliConfigured
void rpmcliConfigured(void)
rpmcliAllPoptTable
struct poptOption rpmcliAllPoptTable[]
rpmcliArgIter
int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv)
rpmInstallFlags_e
rpmInstallFlags_e
Definition rpmcli.h:295
showVerifyPackage
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
rpmInstallSource
int rpmInstallSource(rpmts ts, const char *arg, char **specFilePtr, char **cookie)
rpmDisplayQueryTags
void rpmDisplayQueryTags(FILE *fp)
showQueryPackage
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
rpmcliFini
poptContext rpmcliFini(poptContext optCon)
rpmQueryFlags_e
rpmQueryFlags_e
Definition rpmcli.h:113
rpmcliQueryFlags
rpmQueryFlags rpmcliQueryFlags
rpmErase
int rpmErase(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
rpmQVSources_e
rpmQVSources_e
Definition rpmcli.h:81
rpmcliVerify
int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv)
rpmRestore
int rpmRestore(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
rpmcliInit
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
QSpecF_t
int(* QSpecF_t)(rpmts ts, QVA_t qva, const char *arg)
Definition rpmcli.h:160
INSTALL_FRESHEN
@ INSTALL_FRESHEN
Definition rpmcli.h:303
INSTALL_NOORDER
@ INSTALL_NOORDER
Definition rpmcli.h:300
INSTALL_NODEPS
@ INSTALL_NODEPS
Definition rpmcli.h:299
INSTALL_UPGRADE
@ INSTALL_UPGRADE
Definition rpmcli.h:302
INSTALL_INSTALL
@ INSTALL_INSTALL
Definition rpmcli.h:304
INSTALL_LABEL
@ INSTALL_LABEL
Definition rpmcli.h:301
INSTALL_HASH
@ INSTALL_HASH
Definition rpmcli.h:298
INSTALL_PERCENT
@ INSTALL_PERCENT
Definition rpmcli.h:297
INSTALL_ERASE
@ INSTALL_ERASE
Definition rpmcli.h:305
INSTALL_REINSTALL
@ INSTALL_REINSTALL
Definition rpmcli.h:307
INSTALL_ALLMATCHES
@ INSTALL_ALLMATCHES
Definition rpmcli.h:306
INSTALL_RESTORE
@ INSTALL_RESTORE
Definition rpmcli.h:308
QUERY_FOR_DUMPFILES
@ QUERY_FOR_DUMPFILES
Definition rpmcli.h:121
QUERY_FOR_STATE
@ QUERY_FOR_STATE
Definition rpmcli.h:119
QUERY_FOR_LIST
@ QUERY_FOR_LIST
Definition rpmcli.h:118
RPMQV_WHATCONFLICTS
@ RPMQV_WHATCONFLICTS
Definition rpmcli.h:103
RPMQV_WHATRECOMMENDS
@ RPMQV_WHATRECOMMENDS
Definition rpmcli.h:97
RPMQV_WHATPROVIDES
@ RPMQV_WHATPROVIDES
Definition rpmcli.h:87
RPMQV_PKGID
@ RPMQV_PKGID
Definition rpmcli.h:93
RPMQV_ALL
@ RPMQV_ALL
Definition rpmcli.h:84
RPMQV_HDRID
@ RPMQV_HDRID
Definition rpmcli.h:94
RPMQV_TRIGGEREDBY
@ RPMQV_TRIGGEREDBY
Definition rpmcli.h:89
RPMQV_PATH
@ RPMQV_PATH
Definition rpmcli.h:83
RPMQV_WHATSUGGESTS
@ RPMQV_WHATSUGGESTS
Definition rpmcli.h:98
RPMQV_PACKAGE
@ RPMQV_PACKAGE
Definition rpmcli.h:82
RPMQV_TID
@ RPMQV_TID
Definition rpmcli.h:95
RPMQV_SPECFILE
@ RPMQV_SPECFILE
Definition rpmcli.h:92
RPMQV_SPECBUILTRPMS
@ RPMQV_SPECBUILTRPMS
Definition rpmcli.h:101
RPMQV_DBOFFSET
@ RPMQV_DBOFFSET
Definition rpmcli.h:90
RPMQV_PATH_ALL
@ RPMQV_PATH_ALL
Definition rpmcli.h:104
RPMQV_WHATSUPPLEMENTS
@ RPMQV_WHATSUPPLEMENTS
Definition rpmcli.h:99
RPMQV_SPECSRPM
@ RPMQV_SPECSRPM
Definition rpmcli.h:96
RPMQV_WHATENHANCES
@ RPMQV_WHATENHANCES
Definition rpmcli.h:100
RPMQV_RPM
@ RPMQV_RPM
Definition rpmcli.h:85
RPMQV_SPECRPMS
@ RPMQV_SPECRPMS
Definition rpmcli.h:91
RPMQV_WHATOBSOLETES
@ RPMQV_WHATOBSOLETES
Definition rpmcli.h:102
RPMQV_GROUP
@ RPMQV_GROUP
Definition rpmcli.h:86
RPMQV_WHATREQUIRES
@ RPMQV_WHATREQUIRES
Definition rpmcli.h:88
FD_t
struct _FD_s * FD_t
Definition rpmtypes.h:99
rpmts
struct rpmts_s * rpmts
Definition rpmtypes.h:63
Header
struct headerToken_s * Header
Definition rpmtypes.h:24
rpmVerifyFlags_e
rpmVerifyFlags_e
Definition rpmcli.h:264
VERIFY_CONTEXTS
@ VERIFY_CONTEXTS
Definition rpmcli.h:267
VERIFY_DEPS
@ VERIFY_DEPS
Definition rpmcli.h:269
VERIFY_SCRIPT
@ VERIFY_SCRIPT
Definition rpmcli.h:270
VERIFY_FILES
@ VERIFY_FILES
Definition rpmcli.h:268
rpmcallback.h
rpmCallbackType
enum rpmCallbackType_e rpmCallbackType
rpmcliImportPubkeys
int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv)
rpmVerifySignatures
int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char *fn)
rpmfi.h
rpmlib.h
rpmmacro.h
rpmts.h
rpmurl.h
rpmInstallArguments_s
Definition rpmcli.h:357
rpmQVKArguments_s
Definition rpmcli.h:165
rpmQVKArguments_s::qva_incattr
rpmfileAttrs qva_incattr
Definition rpmcli.h:169
rpmQVKArguments_s::qva_mode
char qva_mode
Definition rpmcli.h:177
rpmQVKArguments_s::qva_showPackage
QVF_t qva_showPackage
Definition rpmcli.h:174
rpmQVKArguments_s::qva_excattr
rpmfileAttrs qva_excattr
Definition rpmcli.h:170
rpmQVKArguments_s::qva_queryFormat
char * qva_queryFormat
Definition rpmcli.h:176
rpmQVKArguments_s::qva_sourceCount
int qva_sourceCount
Definition rpmcli.h:167
rpmQVKArguments_s::qva_flags
rpmQueryFlags qva_flags
Definition rpmcli.h:168
rpmQVKArguments_s::qva_specQuery
QSpecF_t qva_specQuery
Definition rpmcli.h:175
rpmQVKArguments_s::qva_source
rpmQVSources qva_source
Definition rpmcli.h:166
rpmQVKArguments_s::qva_ofvattr
rpmVerifyAttrs qva_ofvattr
Definition rpmcli.h:172
rpmRelocation_s
Definition rpmfiles.h:129