rpm 4.19.92
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
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/* ==================================================================== */
105};
106
107typedef rpmFlags rpmQVSources;
108
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 */
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
150typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h);
151
160typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg);
161
166 rpmQVSources qva_source;
168 rpmQueryFlags qva_flags;
169 rpmfileAttrs qva_incattr;
170 rpmfileAttrs qva_excattr;
172 rpmVerifyAttrs qva_ofvattr;
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
211void rpmDisplayQueryTags(FILE * fp);
212
222
230int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv);
231
240int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv);
241
250
259int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn);
260
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
286int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv);
287
288/* ==================================================================== */
290/* --- install/upgrade/erase modes */
291
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),
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
334void * 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
349int rpmInstallSource(rpmts ts, const char * arg,
350 char ** specFilePtr,
351 char ** cookie);
352
353
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
377int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv);
378
387int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
388
396int rpmRestore(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv);
397
400extern struct rpmInstallArguments_s rpmIArgs;
401
404extern struct poptOption rpmInstallPoptTable[];
405
406/* ==================================================================== */
414int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv);
415
422int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv);
423
424#ifdef __cplusplus
425}
426#endif
427
428#endif /* H_RPMCLI */
int rpmcliVerifySignatures(rpmts ts, ARGV_const_t argv)
void * rpmShowProgress(const void *arg, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, void *data)
int rpmInstall(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_t fileArgv)
int rpmcliQuery(rpmts ts, QVA_t qva, ARGV_const_t argv)
int(* QVF_t)(QVA_t qva, rpmts ts, Header h)
Definition rpmcli.h:150
void rpmcliConfigured(void)
struct poptOption rpmcliAllPoptTable[]
int rpmcliArgIter(rpmts ts, QVA_t qva, ARGV_const_t argv)
rpmInstallFlags_e
Definition rpmcli.h:295
int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
int rpmInstallSource(rpmts ts, const char *arg, char **specFilePtr, char **cookie)
void rpmDisplayQueryTags(FILE *fp)
int showQueryPackage(QVA_t qva, rpmts ts, Header h)
poptContext rpmcliFini(poptContext optCon)
rpmQueryFlags_e
Definition rpmcli.h:113
rpmQueryFlags rpmcliQueryFlags
int rpmErase(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
rpmQVSources_e
Definition rpmcli.h:81
int rpmcliVerify(rpmts ts, QVA_t qva, ARGV_const_t argv)
int rpmRestore(rpmts ts, struct rpmInstallArguments_s *ia, ARGV_const_t argv)
poptContext rpmcliInit(int argc, char *const argv[], struct poptOption *optionsTable)
int(* QSpecF_t)(rpmts ts, QVA_t qva, const char *arg)
Definition rpmcli.h:160
@ INSTALL_FRESHEN
Definition rpmcli.h:303
@ INSTALL_NOORDER
Definition rpmcli.h:300
@ INSTALL_NODEPS
Definition rpmcli.h:299
@ INSTALL_UPGRADE
Definition rpmcli.h:302
@ INSTALL_INSTALL
Definition rpmcli.h:304
@ INSTALL_LABEL
Definition rpmcli.h:301
@ INSTALL_HASH
Definition rpmcli.h:298
@ INSTALL_PERCENT
Definition rpmcli.h:297
@ INSTALL_ERASE
Definition rpmcli.h:305
@ INSTALL_REINSTALL
Definition rpmcli.h:307
@ INSTALL_ALLMATCHES
Definition rpmcli.h:306
@ INSTALL_RESTORE
Definition rpmcli.h:308
@ QUERY_FOR_DUMPFILES
Definition rpmcli.h:121
@ QUERY_FOR_STATE
Definition rpmcli.h:119
@ QUERY_FOR_LIST
Definition rpmcli.h:118
@ RPMQV_WHATCONFLICTS
Definition rpmcli.h:103
@ RPMQV_WHATRECOMMENDS
Definition rpmcli.h:97
@ RPMQV_WHATPROVIDES
Definition rpmcli.h:87
@ RPMQV_PKGID
Definition rpmcli.h:93
@ RPMQV_ALL
Definition rpmcli.h:84
@ RPMQV_HDRID
Definition rpmcli.h:94
@ RPMQV_TRIGGEREDBY
Definition rpmcli.h:89
@ RPMQV_PATH
Definition rpmcli.h:83
@ RPMQV_WHATSUGGESTS
Definition rpmcli.h:98
@ RPMQV_PACKAGE
Definition rpmcli.h:82
@ RPMQV_TID
Definition rpmcli.h:95
@ RPMQV_SPECFILE
Definition rpmcli.h:92
@ RPMQV_SPECBUILTRPMS
Definition rpmcli.h:101
@ RPMQV_DBOFFSET
Definition rpmcli.h:90
@ RPMQV_PATH_ALL
Definition rpmcli.h:104
@ RPMQV_WHATSUPPLEMENTS
Definition rpmcli.h:99
@ RPMQV_SPECSRPM
Definition rpmcli.h:96
@ RPMQV_WHATENHANCES
Definition rpmcli.h:100
@ RPMQV_RPM
Definition rpmcli.h:85
@ RPMQV_SPECRPMS
Definition rpmcli.h:91
@ RPMQV_WHATOBSOLETES
Definition rpmcli.h:102
@ RPMQV_GROUP
Definition rpmcli.h:86
@ RPMQV_WHATREQUIRES
Definition rpmcli.h:88
struct _FD_s * FD_t
Definition rpmtypes.h:99
struct rpmts_s * rpmts
Definition rpmtypes.h:63
struct headerToken_s * Header
Definition rpmtypes.h:24
rpmVerifyFlags_e
Definition rpmcli.h:264
@ VERIFY_CONTEXTS
Definition rpmcli.h:267
@ VERIFY_DEPS
Definition rpmcli.h:269
@ VERIFY_SCRIPT
Definition rpmcli.h:270
@ VERIFY_FILES
Definition rpmcli.h:268
enum rpmCallbackType_e rpmCallbackType
int rpmcliImportPubkeys(rpmts ts, ARGV_const_t argv)
int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char *fn)
Definition rpmcli.h:357
Definition rpmcli.h:165
rpmfileAttrs qva_incattr
Definition rpmcli.h:169
char qva_mode
Definition rpmcli.h:177
QVF_t qva_showPackage
Definition rpmcli.h:174
rpmfileAttrs qva_excattr
Definition rpmcli.h:170
char * qva_queryFormat
Definition rpmcli.h:176
int qva_sourceCount
Definition rpmcli.h:167
rpmQueryFlags qva_flags
Definition rpmcli.h:168
QSpecF_t qva_specQuery
Definition rpmcli.h:175
rpmQVSources qva_source
Definition rpmcli.h:166
rpmVerifyAttrs qva_ofvattr
Definition rpmcli.h:172
Definition rpmfiles.h:129