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/rpmvf.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
/* ==================================================================== */
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,
};
typedef rpmFlags rpmQVSources;
enum rpmQueryFlags_e {
QUERY_FOR_DEFAULT = 0,
QUERY_MD5 = (1 << 0),
QUERY_FILEDIGEST = (1 << 0),
QUERY_SIZE = (1 << 1),
QUERY_LINKTO = (1 << 2),
QUERY_USER = (1 << 3),
QUERY_GROUP = (1 << 4),
QUERY_MTIME = (1 << 5),
QUERY_MODE = (1 << 6),
QUERY_RDEV = (1 << 7),
/* bits 8-14 unused, reserved for rpmVerifyAttrs */
QUERY_CONTEXTS = (1 << 15),
QUERY_FILES = (1 << 16),
QUERY_DEPS = (1 << 17),
QUERY_SCRIPT = (1 << 18),
QUERY_DIGEST = (1 << 19),
QUERY_SIGNATURE = (1 << 20),
QUERY_PATCHES = (1 << 21),
QUERY_HDRCHK = (1 << 22),
QUERY_FOR_LIST = (1 << 23),
QUERY_FOR_STATE = (1 << 24),
QUERY_FOR_DOCS = (1 << 25),
QUERY_FOR_CONFIG = (1 << 26),
QUERY_FOR_DUMPFILES = (1 << 27),
QUERY_FOR_LICENSE = (1 << 28)
};
typedef rpmFlags rpmQueryFlags;
#define _QUERY_FOR_BITS \
(QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
QUERY_FOR_LICENSE|QUERY_FOR_DUMPFILES)
extern rpmQueryFlags rpmcliQueryFlags;
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_fflags;
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 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);
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)
};
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 */