4 /** \ingroup rpmcli rpmbuild
13 * Should version 3 packages be produced?
17 extern int _noDirTokens;
25 * Popt option table for options shared by all modes and executables.
28 extern struct poptOption rpmcliAllPoptTable[];
30 /*@unchecked@*/ /*@observer@*/ /*@null@*/
31 extern const char * rpmcliPipeOutput;
33 /*@unchecked@*/ /*@observer@*/ /*@null@*/
34 extern const char * rpmcliRcfile;
36 /*@unchecked@*/ /*@observer@*/ /*@null@*/
37 extern const char * rpmcliRootDir;
40 * Initialize most everything needed by an rpm CLI executable context.
41 * @param argc no. of args
42 * @param argv arg array
43 * @param optionsTable popt option table
44 * @return popt context (or NULL)
48 rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable)
49 /*@globals rpmCLIMacroContext, rpmGlobalMacroContext, stderr,
50 fileSystem, internalState @*/
51 /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, stderr,
52 fileSystem, internalState @*/;
55 * Make sure that rpm configuration has been read.
56 * @warning Options like --rcfile and --verbose must precede callers option.
59 void rpmcliConfigured(void)
60 /*@globals rpmCLIMacroContext, rpmGlobalMacroContext,
61 fileSystem, internalState @*/
62 /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext,
63 fileSystem, internalState @*/;
66 * Destroy most everything needed by an rpm CLI executable context.
67 * @param optCon popt context
71 rpmcliFini(/*@only@*/ /*@null@*/ poptContext optCon)
72 /*@modifies optCon @*/;
75 * Common/global popt tokens used for command line option tables.
77 #define RPMCLI_POPT_NODEPS -1025
78 #define RPMCLI_POPT_FORCE -1026
79 #define RPMCLI_POPT_NOMD5 -1027
80 #define RPMCLI_POPT_NOSCRIPTS -1028
81 #define RPMCLI_POPT_NOSIGNATURE -1029
82 #define RPMCLI_POPT_NODIGEST -1030
83 #define RPMCLI_POPT_NOHDRCHK -1031
85 /* ==================================================================== */
90 * Query/Verify argument qualifiers.
91 * @todo Reassign to tag values.
93 typedef enum rpmQVSources_e {
94 RPMQV_PACKAGE = 0, /*!< ... from package name db search. */
95 RPMQV_PATH, /*!< ... from file path db search. */
96 RPMQV_ALL, /*!< ... from each installed package. */
97 RPMQV_RPM, /*!< ... from reading binary rpm package. */
98 RPMQV_GROUP, /*!< ... from group db search. */
99 RPMQV_WHATPROVIDES, /*!< ... from provides db search. */
100 RPMQV_WHATREQUIRES, /*!< ... from requires db search. */
101 RPMQV_TRIGGEREDBY, /*!< ... from trigger db search. */
102 RPMQV_DBOFFSET, /*!< ... from database header instance. */
103 RPMQV_SPECFILE, /*!< ... from spec file parse (query only). */
104 RPMQV_PKGID, /*!< ... from package id (header+payload MD5). */
105 RPMQV_HDRID, /*!< ... from header id (immutable header SHA1). */
106 RPMQV_FILEID, /*!< ... from file id (file MD5). */
107 RPMQV_TID /*!< ... from install transaction id (time stamp). */
111 * Bit(s) for rpmVerifyFile() attributes and result.
113 typedef enum rpmVerifyAttrs_e {
114 RPMVERIFY_NONE = 0, /*!< */
115 RPMVERIFY_MD5 = (1 << 0), /*!< from %verify(md5) */
116 RPMVERIFY_FILESIZE = (1 << 1), /*!< from %verify(size) */
117 RPMVERIFY_LINKTO = (1 << 2), /*!< from %verify(link) */
118 RPMVERIFY_USER = (1 << 3), /*!< from %verify(user) */
119 RPMVERIFY_GROUP = (1 << 4), /*!< from %verify(group) */
120 RPMVERIFY_MTIME = (1 << 5), /*!< from %verify(mtime) */
121 RPMVERIFY_MODE = (1 << 6), /*!< from %verify(mode) */
122 RPMVERIFY_RDEV = (1 << 7), /*!< from %verify(rdev) */
123 /* bits 8-15 unused, reserved for rpmVerifyAttrs */
124 /* bits 16-20 used in rpmVerifyFlags */
125 /* bits 21-22 unused */
126 /* bits 23-27 used in rpmQueryFlags */
127 RPMVERIFY_READLINKFAIL= (1 << 28), /*!< */
128 RPMVERIFY_READFAIL = (1 << 29), /*!< */
129 RPMVERIFY_LSTATFAIL = (1 << 30) /*!< */
132 #define RPMVERIFY_ALL ~(RPMVERIFY_NONE)
135 * Bit(s) to control rpmQuery() operation, stored in qva_flags.
136 * @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs?.
138 typedef enum rpmQueryFlags_e {
140 QUERY_FOR_DEFAULT = 0, /*!< */
141 QUERY_MD5 = (1 << 0), /*!< from --nomd5 */
142 QUERY_SIZE = (1 << 1), /*!< from --nosize */
143 QUERY_LINKTO = (1 << 2), /*!< from --nolink */
144 QUERY_USER = (1 << 3), /*!< from --nouser) */
145 QUERY_GROUP = (1 << 4), /*!< from --nogroup) */
146 QUERY_MTIME = (1 << 5), /*!< from --nomtime) */
147 QUERY_MODE = (1 << 6), /*!< from --nomode) */
148 QUERY_RDEV = (1 << 7), /*!< from --nodev */
149 /* bits 8-15 unused, reserved for rpmVerifyAttrs */
150 QUERY_FILES = (1 << 16), /*!< verify: from --nofiles */
151 QUERY_DEPS = (1 << 17), /*!< verify: from --nodeps */
152 QUERY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */
153 QUERY_DIGEST = (1 << 19), /*!< verify: from --nodigest */
154 QUERY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */
155 QUERY_PATCHES = (1 << 21), /*!< placeholder (SuSE) */
156 QUERY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */
158 QUERY_FOR_LIST = (1 << 23), /*!< query: from --list */
159 QUERY_FOR_STATE = (1 << 24), /*!< query: from --state */
160 QUERY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */
161 QUERY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
162 QUERY_FOR_DUMPFILES = (1 << 27) /*!< query: from --dump */
165 #define _QUERY_FOR_BITS \
166 (QUERY_FOR_LIST|QUERY_FOR_STATE|QUERY_FOR_DOCS|QUERY_FOR_CONFIG|\
170 * Bit(s) from common command line options.
173 extern rpmQueryFlags rpmcliQueryFlags;
176 * Bit(s) to control rpmVerify() operation, stored in qva_flags.
177 * @todo Merge rpmQueryFlags, rpmVerifyFlags, and rpmVerifyAttrs values?.
179 typedef enum rpmVerifyFlags_e {
181 VERIFY_DEFAULT = 0, /*!< */
183 VERIFY_MD5 = (1 << 0), /*!< from --nomd5 */
184 VERIFY_SIZE = (1 << 1), /*!< from --nosize */
185 VERIFY_LINKTO = (1 << 2), /*!< from --nolinkto */
186 VERIFY_USER = (1 << 3), /*!< from --nouser */
187 VERIFY_GROUP = (1 << 4), /*!< from --nogroup */
188 VERIFY_MTIME = (1 << 5), /*!< from --nomtime */
189 VERIFY_MODE = (1 << 6), /*!< from --nomode */
190 VERIFY_RDEV = (1 << 7), /*!< from --nodev */
191 /* bits 8-15 unused, reserved for rpmVerifyAttrs */
192 VERIFY_FILES = (1 << 16), /*!< verify: from --nofiles */
193 VERIFY_DEPS = (1 << 17), /*!< verify: from --nodeps */
194 VERIFY_SCRIPT = (1 << 18), /*!< verify: from --noscripts */
195 VERIFY_DIGEST = (1 << 19), /*!< verify: from --nodigest */
196 VERIFY_SIGNATURE = (1 << 20), /*!< verify: from --nosignature */
197 VERIFY_PATCHES = (1 << 21), /*!< placeholder (SuSE) */
198 VERIFY_HDRCHK = (1 << 22), /*!< verify: from --nohdrchk */
200 VERIFY_FOR_LIST = (1 << 23), /*!< query: from --list */
201 VERIFY_FOR_STATE = (1 << 24), /*!< query: from --state */
202 VERIFY_FOR_DOCS = (1 << 25), /*!< query: from --docfiles */
203 VERIFY_FOR_CONFIG = (1 << 26), /*!< query: from --configfiles */
204 VERIFY_FOR_DUMPFILES= (1 << 27) /*!< query: from --dump */
206 /* bits 28-30 used in rpmVerifyAttrs */
209 #define VERIFY_ATTRS \
210 ( VERIFY_MD5 | VERIFY_SIZE | VERIFY_LINKTO | VERIFY_USER | VERIFY_GROUP | \
211 VERIFY_MTIME | VERIFY_MODE | VERIFY_RDEV )
213 ( VERIFY_ATTRS | VERIFY_FILES | VERIFY_DEPS | VERIFY_SCRIPT | VERIFY_DIGEST |\
214 VERIFY_SIGNATURE | VERIFY_HDRCHK )
218 typedef struct rpmQVKArguments_s * QVA_t;
221 * Function to display iterator matches.
223 * @param qva parsed query/verify options
224 * @param ts transaction set
225 * @param h header to use for query/verify
226 * @return 0 on success
228 typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h)
229 /*@globals fileSystem@*/
230 /*@modifies qva, ts, fileSystem @*/;
233 * Function to query spec file.
235 * @param ts transaction set
236 * @param qva parsed query/verify options
237 * @param arg query argument
238 * @return 0 on success
240 typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg)
241 /*@globals rpmGlobalMacroContext,
242 fileSystem, internalState @*/
243 /*@modifies ts, qva, rpmGlobalMacroContext,
244 fileSystem, internalState @*/;
247 * Describe query/verify/signature command line operation.
249 struct rpmQVKArguments_s {
250 rpmQVSources qva_source; /*!< Identify CLI arg type. */
251 int qva_sourceCount;/*!< Exclusive option check (>1 is error). */
252 rpmQueryFlags qva_flags; /*!< Bit(s) to control operation. */
253 rpmfileAttrs qva_fflags; /*!< Bit(s) to filter on attribute. */
254 /*@only@*/ /*@null@*/
255 rpmdbMatchIterator qva_mi; /*!< Match iterator on selected headers. */
257 QVF_t qva_showPackage; /*!< Function to display iterator matches. */
259 QSpecF_t qva_specQuery; /*!< Function to query spec file. */
261 int qva_verbose; /*!< (unused) */
262 /*@only@*/ /*@null@*/
263 const char * qva_queryFormat;/*!< Format for headerSprintf(). */
264 int sign; /*!< Is a passphrase needed? */
266 const char * passPhrase; /*!< Pass phrase. */
267 /*@observer@*/ /*@null@*/
268 const char * qva_prefix; /*!< Path to top of install tree. */
271 - 'q' from --query, -q
272 - 'Q' from --querytags
273 - 'V' from --verify, -V
276 - 'K' from --checksig, -K
279 char qva_char; /*!< (unused) always ' ' */
285 extern struct rpmQVKArguments_s rpmQVKArgs;
290 extern struct poptOption rpmQVSourcePoptTable[];
300 extern struct poptOption rpmQueryPoptTable[];
305 extern struct poptOption rpmVerifyPoptTable[];
308 * Display query/verify information for each header in iterator.
311 * - qva->qva_mi rpm database iterator
312 * - qva->qva_showPackage query/verify display routine
314 * @param qva parsed query/verify options
315 * @param ts transaction set
316 * @return result of last non-zero showPackage() return
318 int rpmcliShowMatches(QVA_t qva, rpmts ts)
319 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
320 /*@modifies qva, rpmGlobalMacroContext, fileSystem, internalState @*/;
323 * Display list of tags that can be used in --queryformat.
324 * @param fp file handle to use for display
326 void rpmDisplayQueryTags(FILE * fp)
327 /*@globals fileSystem@*/
328 /*@modifies *fp, fileSystem @*/;
331 * Common query/verify source interface, called once for each CLI arg.
334 * - qva->qva_mi rpm database iterator
335 * - qva->qva_showPackage query/verify display routine
337 * @param qva parsed query/verify options
338 * @param ts transaction set
339 * @param arg name of source to query/verify
340 * @return showPackage() result, 1 if rpmdbInitIterator() is NULL
342 int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg)
343 /*@globals rpmGlobalMacroContext,
344 fileSystem, internalState @*/
345 /*@modifies qva, ts, rpmGlobalMacroContext,
346 fileSystem, internalState @*/;
349 * Display results of package query.
350 * @todo Devise a meaningful return code.
351 * @param qva parsed query/verify options
352 * @param ts transaction set
353 * @param h header to use for query
356 int showQueryPackage(QVA_t qva, rpmts ts, Header h)
357 /*@globals fileSystem, internalState @*/
358 /*@modifies ts, h, fileSystem, internalState @*/;
361 * Display package information.
362 * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union?
363 * @param ts transaction set
364 * @param qva parsed query/verify options
365 * @param argv query argument(s) (or NULL)
366 * @return 0 on success, else no. of failures
368 int rpmcliQuery(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
369 /*@globals rpmGlobalMacroContext,
370 fileSystem, internalState @*/
371 /*@modifies ts, qva, rpmGlobalMacroContext,
372 fileSystem, internalState @*/;
375 * Verify file attributes (including MD5 sum).
376 * @todo gnorpm and python bindings prevent this from being static.
377 * @param ts transaction set
378 * @param fi file info (with linked header and current file index)
379 * @retval *res bit(s) returned to indicate failure
380 * @param omitMask bit(s) to disable verify checks
381 * @return 0 on success (or not installed), 1 on error
384 int rpmVerifyFile(const rpmts ts, rpmfi fi,
385 /*@out@*/ rpmVerifyAttrs * res, rpmVerifyAttrs omitMask)
386 /*@globals fileSystem, internalState @*/
387 /*@modifies fi, *res, fileSystem, internalState @*/
388 /*@requires maxSet(res) >= 0 @*/;
392 * Display results of package verify.
393 * @param qva parsed query/verify options
394 * @param ts transaction set
395 * @param h header to use for verify
396 * @return result of last non-zero verify return
398 int showVerifyPackage(QVA_t qva, rpmts ts, Header h)
399 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
400 /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
403 * Check package and header signatures.
404 * @param qva parsed query/verify options
405 * @param ts transaction set
406 * @param fd package file handle
407 * @param fn package file name
408 * @return 0 on success, 1 on failure
410 int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn)
411 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
412 /*@modifies qva, ts, fd, rpmGlobalMacroContext,
413 fileSystem, internalState @*/;
416 * Verify package install.
417 * @todo hack: RPMQV_ALL can pass char ** arglist = NULL, not char * arg. Union?
418 * @param ts transaction set
419 * @param qva parsed query/verify options
420 * @param argv verify argument(s) (or NULL)
421 * @return 0 on success, else no. of failures
423 int rpmcliVerify(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
424 /*@globals rpmGlobalMacroContext,
425 fileSystem, internalState @*/
426 /*@modifies ts, qva, rpmGlobalMacroContext,
427 fileSystem, internalState @*/;
430 /* ==================================================================== */
435 * Describe build command line request.
437 struct rpmBuildArguments_s {
438 rpmQueryFlags qva_flags; /*!< Bit(s) to control verification. */
439 int buildAmount; /*!< Bit(s) to control operation. */
441 const char * buildRootOverride; /*!< from --buildroot */
443 char * targets; /*!< Target platform(s), comma separated. */
445 const char * passPhrase; /*!< Pass phrase. */
446 /*@only@*/ /*@null@*/
447 const char * cookie; /*!< NULL for binary, ??? for source, rpm's */
448 int force; /*!< from --force */
449 int noBuild; /*!< from --nobuild */
450 int noDeps; /*!< from --nodeps */
451 int noLang; /*!< from --nolang */
452 int shortCircuit; /*!< from --short-circuit */
453 int sign; /*!< from --sign */
454 int useCatalog; /*!< from --usecatalog */
455 char buildMode; /*!< Build mode (one of "btBC") */
456 char buildChar; /*!< Build stage (one of "abcilps ") */
457 /*@observer@*/ /*@null@*/
458 const char * rootdir;
463 typedef struct rpmBuildArguments_s * BTA_t;
468 extern struct rpmBuildArguments_s rpmBTArgs;
473 extern struct poptOption rpmBuildPoptTable[];
476 /* ==================================================================== */
479 /* --- install/upgrade/erase modes */
482 extern int rpmcliPackagesTotal;
484 extern int rpmcliHashesCurrent;
486 extern int rpmcliHashesTotal;
488 extern int rpmcliProgressCurrent;
490 extern int rpmcliProgressTotal;
493 * The rpm CLI generic transaction callback handler.
494 * @todo Remove headerSprintf() from the progress callback.
495 * @deprecated Transaction callback arguments need to change, so don't rely on
496 * this routine in the rpmcli API.
498 * @param arg per-callback private data (e.g. an rpm header)
499 * @param what callback identifier
500 * @param amount per-callback progress info
501 * @param total per-callback progress info
502 * @param key opaque header key (e.g. file name or PyObject)
503 * @param data private data (e.g. rpmInstallInterfaceFlags)
504 * @return per-callback data (e.g. an opened FD_t)
507 void * rpmShowProgress(/*@null@*/ const void * arg,
508 const rpmCallbackType what,
509 const unsigned long amount,
510 const unsigned long total,
511 /*@null@*/ fnpyKey key,
512 /*@null@*/ void * data)
513 /*@globals rpmcliHashesCurrent,
514 rpmcliProgressCurrent, rpmcliProgressTotal,
515 fileSystem, internalState @*/
516 /*@modifies rpmcliHashesCurrent,
517 rpmcliProgressCurrent, rpmcliProgressTotal,
518 fileSystem, internalState @*/;
521 * Install source rpm package.
522 * @param ts transaction set
523 * @param arg source rpm file name
524 * @retval *specFilePtr (installed) spec file name
526 * @return 0 on success
528 int rpmInstallSource(rpmts ts, const char * arg,
529 /*@null@*/ /*@out@*/ const char ** specFilePtr,
530 /*@null@*/ /*@out@*/ const char ** cookie)
531 /*@globals rpmGlobalMacroContext,
532 fileSystem, internalState@*/
533 /*@modifies ts, *specFilePtr, *cookie, rpmGlobalMacroContext,
534 fileSystem, internalState @*/;
537 * Describe database command line requests.
539 struct rpmInstallArguments_s {
540 rpmtransFlags transFlags;
541 rpmprobFilterFlags probFilter;
542 rpmInstallInterfaceFlags installInterfaceFlags;
543 rpmEraseInterfaceFlags eraseInterfaceFlags;
544 rpmQueryFlags qva_flags; /*!< from --nodigest/--nosignature */
545 uint_32 rbtid; /*!< from --rollback */
549 /*@owned@*/ /*@null@*/
550 rpmRelocation * relocations;
553 /*@observer@*/ /*@null@*/
554 const char * rootdir;
558 * Install/upgrade/freshen binary rpm package.
559 * @param ts transaction set
560 * @param ia mode flags and parameters
561 * @param fileArgv array of package file names (NULL terminated)
562 * @return 0 on success
564 int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia,
565 /*@null@*/ const char ** fileArgv)
566 /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext,
567 fileSystem, internalState@*/
568 /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
569 fileSystem, internalState @*/;
572 * Erase binary rpm package.
573 * @param ts transaction set
574 * @param ia control args/bits
575 * @param argv array of package file names (NULL terminated)
576 * @return 0 on success
578 int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia,
579 /*@null@*/ const char ** argv)
580 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
581 /*@modifies ts, ia, rpmGlobalMacroContext,
582 fileSystem, internalState @*/;
585 * A rollback transaction id element.
588 typedef /*@abstract@*/ struct IDT_s {
589 unsigned int instance; /*!< installed package transaction id. */
590 /*@owned@*/ /*@null@*/
591 const char * key; /*! removed package file name. */
592 Header h; /*!< removed package header. */
594 uint_32 u32; /*!< install/remove transaction id */
600 * A rollback transaction id index.
602 typedef /*@abstract@*/ struct IDTindex_s {
603 int delta; /*!< no. elements to realloc as a chunk. */
604 int size; /*!< size of id index element. */
605 int alloced; /*!< current number of elements allocated. */
606 int nidt; /*!< current number of elements initialized. */
607 /*@only@*/ /*@null@*/
608 IDT idt; /*!< id index elements. */
613 * @param idtx id index
614 * @return NULL always
617 IDTX IDTXfree(/*@only@*/ /*@null@*/ IDTX idtx)
618 /*@modifies idtx @*/;
622 * @return new id index
629 * Insure that index has room for "need" elements.
630 * @param idtx id index
631 * @param need additional no. of elements needed
632 * @return id index (with room for "need" elements)
634 /*@only@*/ /*@null@*/
635 IDTX IDTXgrow(/*@only@*/ /*@null@*/ IDTX idtx, int need)
636 /*@modifies idtx @*/;
639 * Sort tag (instance,value) pairs.
640 * @param idtx id index
643 /*@only@*/ /*@null@*/
644 IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx)
645 /*@modifies idtx @*/;
648 * Load tag (instance,value) pairs from rpm databse, and return sorted id index.
649 * @param ts transaction set
653 /*@only@*/ /*@null@*/
654 IDTX IDTXload(rpmts ts, rpmTag tag)
655 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
656 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
659 * Load tag (instance,value) pairs from packages, and return sorted id index.
660 * @param ts transaction set
661 * @param globstr glob expression
665 /*@only@*/ /*@null@*/
666 IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag)
667 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
668 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
671 * Rollback transactions, erasing new, reinstalling old, package(s).
672 * @param ts transaction set
673 * @param ia mode flags and parameters
674 * @param argv array of arguments (NULL terminated)
675 * @return 0 on success
677 int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia,
678 /*@null@*/ const char ** argv)
679 /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext,
680 fileSystem, internalState @*/
681 /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext,
682 fileSystem, internalState @*/;
687 extern struct rpmInstallArguments_s rpmIArgs;
692 extern struct poptOption rpmInstallPoptTable[];
695 /* ==================================================================== */
698 /* --- database modes */
701 * Describe database command line requests.
703 struct rpmDatabaseArguments_s {
704 int init; /*!< from --initdb */
705 int rebuild; /*!< from --rebuilddb */
706 int verify; /*!< from --verifydb */
712 extern struct rpmDatabaseArguments_s rpmDBArgs;
717 extern struct poptOption rpmDatabasePoptTable[];
720 /* ==================================================================== */
725 * Import public key packet(s).
726 * @todo Implicit --update policy for gpg-pubkey headers.
727 * @param ts transaction set
728 * @param pkt pgp pubkey packet(s)
729 * @param pktlen pgp pubkey length
730 * @return RPMRC_OK/RPMRC_FAIL
732 rpmRC rpmcliImportPubkey(const rpmts ts,
733 const unsigned char * pkt, ssize_t pktlen)
734 /*@globals RPMVERSION, rpmGlobalMacroContext,
735 fileSystem, internalState @*/
736 /*@modifies ts, rpmGlobalMacroContext,
737 fileSystem, internalState @*/;
740 * Bit(s) to control rpmReSign() operation.
743 typedef enum rpmSignFlags_e {
745 RPMSIGN_CHK_SIGNATURE = 'K', /*!< from --checksig */
746 RPMSIGN_NEW_SIGNATURE = 'R', /*!< from --resign */
747 RPMSIGN_ADD_SIGNATURE = 'A', /*!< from --addsign */
748 RPMSIGN_IMPORT_PUBKEY = 'I', /*!< from --import */
755 extern struct poptOption rpmSignPoptTable[];
758 * Create/Modify/Check elements from signature header.
759 * @param ts transaction set
760 * @param qva mode flags and parameters
761 * @param argv array of arguments (NULL terminated)
762 * @return 0 on success
764 int rpmcliSign(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv)
765 /*@globals RPMVERSION, rpmGlobalMacroContext,
766 fileSystem, internalState @*/
767 /*@modifies ts, qva, rpmGlobalMacroContext,
768 fileSystem, internalState @*/;
776 #endif /* H_RPMCLI */