rpm: /srv/include/rpm/rpmcli.h Source File

rpm 4.20.1 The RPM Package Manager

Loading...
Searching...
No Matches
rpmcli.h
Go to the documentation of this file.
1#ifndef H_RPMCLI
2#define H_RPMCLI
3
10#include <popt.h>
11
12#include <rpm/rpmlib.h>
13#include <rpm/rpmurl.h>
14#include <rpm/rpmmacro.h>
15#include <rpm/rpmcallback.h>
16#include <rpm/rpmts.h>
17#include <rpm/rpmfi.h>
18#include <rpm/argv.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
27extern struct poptOption rpmcliAllPoptTable[];
28
29extern const char * rpmcliPipeOutput;
30
31extern const char * rpmcliRcfile;
32
33extern const char * rpmcliRootDir;
34
42poptContext
43rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable);
44
49 void rpmcliConfigured(void);
50
56poptContext
57rpmcliFini(poptContext optCon);
58
62#define RPMCLI_POPT_NODEPS -1025
63#define RPMCLI_POPT_FORCE -1026
64#define RPMCLI_POPT_NOMD5 -1027
65#define RPMCLI_POPT_NOFILEDIGEST -1027 /* same as obsolete RPMCLI_POPT_NOMD5 */
66#define RPMCLI_POPT_NOSCRIPTS -1028
67#define RPMCLI_POPT_NOSIGNATURE -1029
68#define RPMCLI_POPT_NODIGEST -1030
69#define RPMCLI_POPT_NOHDRCHK -1031
70#define RPMCLI_POPT_NOCONTEXTS -1032
71#define RPMCLI_POPT_NOCAPS -1033
72#define RPMCLI_POPT_TARGETPLATFORM -1034
73
74/* ==================================================================== */
81 enum rpmQVSources_e {
82 RPMQV_PACKAGE = 0,
83 RPMQV_PATH,
84 RPMQV_ALL,
85 RPMQV_RPM,
86 RPMQV_GROUP,
87 RPMQV_WHATPROVIDES,
88 RPMQV_WHATREQUIRES,
89 RPMQV_TRIGGEREDBY,
90 RPMQV_DBOFFSET,
91 RPMQV_SPECRPMS,
92 RPMQV_SPECFILE = RPMQV_SPECRPMS,
93 RPMQV_PKGID,
94 RPMQV_HDRID,
95 RPMQV_TID,
96 RPMQV_SPECSRPM,
97 RPMQV_WHATRECOMMENDS,
98 RPMQV_WHATSUGGESTS,
99 RPMQV_WHATSUPPLEMENTS,
100 RPMQV_WHATENHANCES,
101 RPMQV_SPECBUILTRPMS,
102 RPMQV_WHATOBSOLETES,
103 RPMQV_WHATCONFLICTS,
104 RPMQV_PATH_ALL,
105};
106
107typedef rpmFlags rpmQVSources;
108
113 enum rpmQueryFlags_e {
114 QUERY_FOR_DEFAULT = 0,
115 /* bits 0-14 unused */
116 /* bits 15-18 reserved for rpmVerifyFlags */
117 /* bits 19-21 unused */
118 QUERY_FOR_LIST = (1 << 23),
119 QUERY_FOR_STATE = (1 << 24),
120 /* bits 25-26 unused */
121 QUERY_FOR_DUMPFILES = (1 << 27),
122};
123
124typedef rpmFlags rpmQueryFlags;
125
126#define _QUERY_FOR_BITS \
127 (QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DUMPFILES)
128
132extern rpmQueryFlags rpmcliQueryFlags;
133
134extern rpmVSFlags rpmcliVSFlags;
135
136extern int rpmcliVfyLevelMask;
137
140typedef struct rpmQVKArguments_s * QVA_t;
141
150 typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h);
151
160 typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg);
161
165 struct rpmQVKArguments_s {
166 rpmQVSources qva_source;
167 int qva_sourceCount;
168 rpmQueryFlags qva_flags;
169 rpmfileAttrs qva_incattr;
170 rpmfileAttrs qva_excattr;
172 rpmVerifyAttrs qva_ofvattr;
174 QVF_t qva_showPackage;
175 QSpecF_t qva_specQuery;
176 char * qva_queryFormat;
177 char qva_mode;
185};
186
189extern struct rpmQVKArguments_s rpmQVKArgs;
190
193extern struct poptOption rpmQVSourcePoptTable[];
194
197extern struct poptOption rpmQVFilePoptTable[];
198
201extern struct poptOption rpmQueryPoptTable[];
202
205extern struct poptOption rpmVerifyPoptTable[];
206
211 void rpmDisplayQueryTags(FILE * fp);
212
221 int showQueryPackage(QVA_t qva, rpmts ts, Header h);
222
230 int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv);
231
240 int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv);
241
249 int showVerifyPackage(QVA_t qva, rpmts ts, Header h);
250
259 int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn);
260
264 enum rpmVerifyFlags_e {
265 VERIFY_DEFAULT = 0,
266 /* bits 1-14 unused */
267 VERIFY_CONTEXTS = (1 << 15),
268 VERIFY_FILES = (1 << 16),
269 VERIFY_DEPS = (1 << 17),
270 VERIFY_SCRIPT = (1 << 18),
271};
272
273typedef rpmFlags rpmVerifyFlags;
274
275#define VERIFY_ALL \
276 ( VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT )
277
286 int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv);
287
288/* ==================================================================== */
290/* --- install/upgrade/erase modes */
291
295 enum rpmInstallFlags_e {
296 INSTALL_NONE = 0,
297 INSTALL_PERCENT = (1 << 0),
298 INSTALL_HASH = (1 << 1),
299 INSTALL_NODEPS = (1 << 2),
300 INSTALL_NOORDER = (1 << 3),
301 INSTALL_LABEL = (1 << 4),
302 INSTALL_UPGRADE = (1 << 5),
303 INSTALL_FRESHEN = (1 << 6),
304 INSTALL_INSTALL = (1 << 7),
305 INSTALL_ERASE = (1 << 8),
306 INSTALL_ALLMATCHES = (1 << 9),
307 INSTALL_REINSTALL = (1 << 10),
308 INSTALL_RESTORE = (1 << 11),
309};
310
311typedef rpmFlags rpmInstallFlags;
312
316#define UNINSTALL_NONE INSTALL_NONE
317#define UNINSTALL_NODEPS INSTALL_NODEPS
318#define UNINSTALL_ALLMATCHES INSTALL_ALLMATCHES
319
334 void * rpmShowProgress(const void * arg,
335 const rpmCallbackType what,
336 const rpm_loff_t amount,
337 const rpm_loff_t total,
338 fnpyKey key,
339 void * data);
340
349 int rpmInstallSource(rpmts ts, const char * arg,
350 char ** specFilePtr,
351 char ** cookie);
352
353
357 struct rpmInstallArguments_s {
358 rpmtransFlags transFlags;
359 rpmprobFilterFlags probFilter;
360 rpmInstallFlags installInterfaceFlags;
361 int numRelocations;
362 int noDeps;
363 int incldocs;
364 rpmRelocation * relocations;
365 char * prefix;
366};
367
377 int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv);
378
387 int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
388
396 int rpmRestore(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
397
400extern struct rpmInstallArguments_s rpmIArgs;
401
404extern struct poptOption rpmInstallPoptTable[];
405
406/* ==================================================================== */
414 int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv);
415
422 int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv);
423
424#ifdef __cplusplus
425}
426#endif
427
428#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