6 * Structures and prototypes used for an "rpmts" transaction set.
14 extern int _rpmts_debug;
16 extern int _rpmts_stats;
18 extern int _fps_debug;
22 * Bit(s) to control digest and signature verification.
24 typedef enum rpmVSFlags_e {
26 RPMVSF_NOHDRCHK = (1 << 0),
27 RPMVSF_NEEDPAYLOAD = (1 << 1),
28 /* bit(s) 2-7 unused */
29 RPMVSF_NOSHA1HEADER = (1 << 8),
30 RPMVSF_NOMD5HEADER = (1 << 9), /* unimplemented */
31 RPMVSF_NODSAHEADER = (1 << 10),
32 RPMVSF_NORSAHEADER = (1 << 11), /* unimplemented */
33 /* bit(s) 12-15 unused */
34 RPMVSF_NOSHA1 = (1 << 16), /* unimplemented */
35 RPMVSF_NOMD5 = (1 << 17),
36 RPMVSF_NODSA = (1 << 18),
37 RPMVSF_NORSA = (1 << 19)
38 /* bit(s) 16-31 unused */
41 #define _RPMVSF_NODIGESTS \
42 ( RPMVSF_NOSHA1HEADER | \
43 RPMVSF_NOMD5HEADER | \
47 #define _RPMVSF_NOSIGNATURES \
48 ( RPMVSF_NODSAHEADER | \
49 RPMVSF_NORSAHEADER | \
53 #define _RPMVSF_NOHEADER \
54 ( RPMVSF_NOSHA1HEADER | \
55 RPMVSF_NOMD5HEADER | \
56 RPMVSF_NODSAHEADER | \
59 #define _RPMVSF_NOPAYLOAD \
65 #if defined(_RPMTS_INTERNAL)
67 #include "rpmhash.h" /* XXX hashTable */
68 #include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/
72 extern int _cacheDependsRC;
77 typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo;
81 struct diskspaceInfo_s {
82 dev_t dev; /*!< File system device number. */
83 signed long bneeded; /*!< No. of blocks needed. */
84 signed long ineeded; /*!< No. of inodes needed. */
85 int bsize; /*!< File system block size. */
86 signed long long bavail; /*!< No. of blocks available. */
87 signed long long iavail; /*!< No. of inodes available. */
91 * Adjust for root only reserved space. On linux e2fs, this is 5%.
93 #define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
95 /* argon thought a shift optimization here was a waste of time... he's
97 #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
101 typedef enum tsStage_e {
108 * The set of packages to be installed/removed atomically.
111 rpmtransFlags transFlags; /*!< Bit(s) to control operation. */
112 tsmStage goal; /*!< Transaction goal (i.e. mode) */
114 /*@refcounted@*/ /*@null@*/
115 rpmdb sdb; /*!< Solve database handle. */
116 int sdbmode; /*!< Solve database open mode. */
118 int (*solve) (rpmts ts, rpmds key, const void * data)
119 /*@modifies ts @*/; /*!< Search for NEVRA key. */
121 const void * solveData; /*!< Solve callback data */
122 int nsuggests; /*!< No. of depCheck suggestions. */
123 /*@only@*/ /*@null@*/
124 const void ** suggests; /*!< Possible depCheck suggestions. */
126 /*@observer@*/ /*@null@*/
127 rpmCallbackFunction notify; /*!< Callback function. */
128 /*@observer@*/ /*@null@*/
129 rpmCallbackData notifyData; /*!< Callback private data. */
131 /*@refcounted@*/ /*@null@*/
132 rpmps probs; /*!< Current problems in transaction. */
133 rpmprobFilterFlags ignoreSet;
134 /*!< Bits to filter current problems. */
136 int filesystemCount; /*!< No. of mounted filesystems. */
137 /*@dependent@*/ /*@null@*/
138 const char ** filesystems; /*!< Mounted filesystem names. */
139 /*@only@*/ /*@null@*/
140 rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */
142 /*@refcounted@*/ /*@null@*/
143 rpmdb rdb; /*!< Install database handle. */
144 int dbmode; /*!< Install database open mode. */
146 hashTable ht; /*!< Fingerprint hash table. */
148 /*@only@*/ /*@null@*/
149 int * removedPackages; /*!< Set of packages being removed. */
150 int numRemovedPackages; /*!< No. removed package instances. */
151 int allocedRemovedPackages; /*!< Size of removed packages array. */
154 rpmal addedPackages; /*!< Set of packages being installed. */
155 int numAddedPackages; /*!< No. added package instances. */
159 rpmal availablePackages; /*!< Universe of available packages. */
160 int numAvailablePackages; /*!< No. available package instances. */
164 rpmte relocateElement; /*!< Element to use when relocating packages. */
166 /*@owned@*/ /*@relnull@*/
167 rpmte * order; /*!< Packages sorted by dependencies. */
168 int orderCount; /*!< No. of transaction elements. */
169 int orderAlloced; /*!< No. of allocated transaction elements. */
170 int unorderedSuccessors; /*!< Index of 1st element of successors. */
172 int chrootDone; /*!< Has chroot(2) been been done? */
173 /*@only@*/ /*@null@*/
174 const char * rootDir; /*!< Path to top of install tree. */
175 /*@only@*/ /*@null@*/
176 const char * currDir; /*!< Current working directory. */
178 FD_t scriptFd; /*!< Scriptlet stdout/stderr. */
179 int delta; /*!< Delta for reallocation. */
180 int_32 tid; /*!< Transaction id. */
182 uint_32 color; /*!< Transaction color bits. */
184 rpmVSFlags vsflags; /*!< Signature/digest verification flags. */
186 /*@observer@*/ /*@dependent@*/ /*@null@*/
187 const char * fn; /*!< Current package fn. */
188 int_32 sigtag; /*!< Current package signature tag. */
189 int_32 sigtype; /*!< Current package signature data type. */
191 const void * sig; /*!< Current package signature. */
192 int_32 siglen; /*!< Current package signature length. */
194 /*@only@*/ /*@null@*/
195 const unsigned char * pkpkt;/*!< Current pubkey packet. */
196 size_t pkpktlen; /*!< Current pubkey packet length. */
197 unsigned char pksignid[8]; /*!< Current pubkey fingerprint. */
199 struct rpmop_s op_total;
200 struct rpmop_s op_check;
201 struct rpmop_s op_order;
202 struct rpmop_s op_fingerprint;
203 struct rpmop_s op_repackage;
204 struct rpmop_s op_install;
205 struct rpmop_s op_erase;
206 struct rpmop_s op_scriptlets;
207 struct rpmop_s op_compress;
208 struct rpmop_s op_uncompress;
209 struct rpmop_s op_digest;
210 struct rpmop_s op_signature;
211 struct rpmop_s op_dbadd;
212 struct rpmop_s op_dbremove;
213 struct rpmop_s op_dbget;
214 struct rpmop_s op_dbput;
215 struct rpmop_s op_dbdel;
218 pgpDig dig; /*!< Current signature/pubkey parameters. */
221 Spec spec; /*!< Spec file control structure. */
224 int nrefs; /*!< Reference count. */
227 #endif /* _RPMTS_INTERNAL */
234 * Check that all dependencies can be resolved.
235 * @param ts transaction set
236 * @return 0 on success
238 int rpmtsCheck(rpmts ts)
239 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
240 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
243 * Determine package order in a transaction set according to dependencies.
245 * Order packages, returning error if circular dependencies cannot be
246 * eliminated by removing Requires's from the loop(s). Only dependencies from
247 * added or removed packages are used to determine ordering using a
248 * topological sort (Knuth vol. 1, p. 262). Use rpmtsCheck() to verify
249 * that all dependencies can be resolved.
251 * The final order ends up as installed packages followed by removed packages,
252 * with packages removed for upgrades immediately following the new package
255 * @param ts transaction set
256 * @return no. of (added) packages that could not be ordered
258 int rpmtsOrder(rpmts ts)
259 /*@globals fileSystem, internalState@*/
260 /*@modifies ts, fileSystem, internalState @*/;
263 * Process all package elements in a transaction set.
265 * @param ts transaction set
266 * @param okProbs previously known problems (or NULL)
267 * @param ignoreSet bits to filter problem types
268 * @return 0 on success, -1 on error, >0 with newProbs set
270 int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
271 /*@globals rpmGlobalMacroContext,
272 fileSystem, internalState@*/
273 /*@modifies ts, rpmGlobalMacroContext,
274 fileSystem, internalState @*/;
277 * Unreference a transaction instance.
278 * @param ts transaction set
280 * @return NULL always
282 /*@unused@*/ /*@null@*/
283 rpmts rpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
287 /** @todo Remove debugging entry from the ABI. */
290 rpmts XrpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
291 const char * msg, const char * fn, unsigned ln)
294 #define rpmtsUnlink(_ts, _msg) XrpmtsUnlink(_ts, _msg, __FILE__, __LINE__)
297 * Reference a transaction set instance.
298 * @param ts transaction set
300 * @return new transaction set reference
303 rpmts rpmtsLink (rpmts ts, const char * msg)
306 /** @todo Remove debugging entry from the ABI. */
307 rpmts XrpmtsLink (rpmts ts,
308 const char * msg, const char * fn, unsigned ln)
310 #define rpmtsLink(_ts, _msg) XrpmtsLink(_ts, _msg, __FILE__, __LINE__)
313 * Close the database used by the transaction.
314 * @param ts transaction set
315 * @return 0 on success
317 int rpmtsCloseDB(rpmts ts)
318 /*@globals fileSystem @*/
319 /*@modifies ts, fileSystem @*/;
322 * Open the database used by the transaction.
323 * @param ts transaction set
324 * @param dbmode O_RDONLY or O_RDWR
325 * @return 0 on success
327 int rpmtsOpenDB(rpmts ts, int dbmode)
328 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
329 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
332 * Initialize the database used by the transaction.
333 * @deprecated An explicit rpmdbInit() is almost never needed.
334 * @param ts transaction set
335 * @param dbmode O_RDONLY or O_RDWR
336 * @return 0 on success
338 int rpmtsInitDB(rpmts ts, int dbmode)
339 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
340 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
343 * Rebuild the database used by the transaction.
344 * @param ts transaction set
345 * @return 0 on success
347 int rpmtsRebuildDB(rpmts ts)
348 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
349 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
352 * Verify the database used by the transaction.
353 * @param ts transaction set
354 * @return 0 on success
356 int rpmtsVerifyDB(rpmts ts)
357 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
358 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
361 * Return transaction database iterator.
362 * @param ts transaction set
363 * @param rpmtag rpm tag
364 * @param keyp key data (NULL for sequential access)
365 * @param keylen key data length (0 will use strlen(keyp))
366 * @return NULL on failure
368 /*@only@*/ /*@null@*/
369 rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
370 /*@null@*/ const void * keyp, size_t keylen)
371 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
372 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
375 * Retrieve pubkey from rpm database.
376 * @param ts rpm transaction
377 * @return RPMRC_OK on success, RPMRC_NOKEY if not found
379 rpmRC rpmtsFindPubkey(rpmts ts)
380 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
381 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState */;
384 * Close the database used by the transaction to solve dependencies.
385 * @param ts transaction set
386 * @return 0 on success
389 int rpmtsCloseSDB(rpmts ts)
390 /*@globals fileSystem @*/
391 /*@modifies ts, fileSystem @*/;
395 * Open the database used by the transaction to solve dependencies.
396 * @param ts transaction set
397 * @param dbmode O_RDONLY or O_RDWR
398 * @return 0 on success
401 int rpmtsOpenSDB(rpmts ts, int dbmode)
402 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
403 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
407 * Attempt to solve a needed dependency using the solve database.
408 * @param ts transaction set
409 * @param ds dependency set
410 * @param data opaque data associated with callback
411 * @return -1 retry, 0 ignore, 1 not found
414 int rpmtsSolve(rpmts ts, rpmds ds, const void * data)
415 /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
416 /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
420 * Attempt to solve a needed dependency using memory resident tables.
421 * @deprecated This function will move from rpmlib to the python bindings.
422 * @param ts transaction set
423 * @param ds dependency set
424 * @return 0 if resolved (and added to ts), 1 not found
427 int rpmtsAvailable(rpmts ts, const rpmds ds)
428 /*@globals fileSystem @*/
429 /*@modifies ts, fileSystem @*/;
432 * Set dependency solver callback.
433 * @param ts transaction set
434 * @param (*solve) dependency solver callback
435 * @param solveData dependency solver callback data (opaque)
436 * @return 0 on success
438 int rpmtsSetSolveCallback(rpmts ts,
439 int (*solve) (rpmts ts, rpmds ds, const void * data),
440 const void * solveData)
444 * Return current transaction set problems.
445 * @param ts transaction set
446 * @return current problem set (or NULL)
449 rpmps rpmtsProblems(rpmts ts)
453 * Free signature verification data.
454 * @param ts transaction set
456 void rpmtsCleanDig(rpmts ts)
460 * Free memory needed only for dependency checks and ordering.
461 * @param ts transaction set
463 void rpmtsClean(rpmts ts)
464 /*@globals fileSystem @*/
465 /*@modifies ts, fileSystem @*/;
468 * Re-create an empty transaction set.
469 * @param ts transaction set
471 void rpmtsEmpty(rpmts ts)
472 /*@globals fileSystem @*/
473 /*@modifies ts, fileSystem @*/;
476 * Destroy transaction set, closing the database as well.
477 * @param ts transaction set
478 * @return NULL always
481 rpmts rpmtsFree(/*@killref@*/ /*@only@*//*@null@*/ rpmts ts)
482 /*@globals fileSystem @*/
483 /*@modifies ts, fileSystem @*/;
486 * Get verify signatures flag(s).
487 * @param ts transaction set
488 * @return verify signatures flags
490 rpmVSFlags rpmtsVSFlags(rpmts ts)
494 * Set verify signatures flag(s).
495 * @param ts transaction set
496 * @param vsflags new verify signatures flags
497 * @return previous value
499 rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
503 * Set index of 1st element of successors.
504 * @param ts transaction set
505 * @param first new index of 1st element of successors
506 * @return previous value
508 int rpmtsUnorderedSuccessors(rpmts ts, int first)
512 * Get transaction rootDir, i.e. path to chroot(2).
513 * @param ts transaction set
514 * @return transaction rootDir
516 /*@observer@*/ /*@null@*/
517 extern const char * rpmtsRootDir(rpmts ts)
521 * Set transaction rootDir, i.e. path to chroot(2).
522 * @param ts transaction set
523 * @param rootDir new transaction rootDir (or NULL)
525 void rpmtsSetRootDir(rpmts ts, /*@null@*/ const char * rootDir)
529 * Get transaction currDir, i.e. current directory before chroot(2).
530 * @param ts transaction set
531 * @return transaction currDir
533 /*@observer@*/ /*@null@*/
534 extern const char * rpmtsCurrDir(rpmts ts)
538 * Set transaction currDir, i.e. current directory before chroot(2).
539 * @param ts transaction set
540 * @param currDir new transaction currDir (or NULL)
542 void rpmtsSetCurrDir(rpmts ts, /*@null@*/ const char * currDir)
546 * Get transaction script file handle, i.e. stdout/stderr on scriptlet execution
547 * @param ts transaction set
548 * @return transaction script file handle
551 FD_t rpmtsScriptFd(rpmts ts)
555 * Set transaction script file handle, i.e. stdout/stderr on scriptlet execution
556 * @param ts transaction set
557 * @param scriptFd new script file handle (or NULL)
559 void rpmtsSetScriptFd(rpmts ts, /*@null@*/ FD_t scriptFd)
560 /*@modifies ts, scriptFd @*/;
563 * Get chrootDone flag, i.e. has chroot(2) been performed?
564 * @param ts transaction set
565 * @return chrootDone flag
567 int rpmtsChrootDone(rpmts ts)
571 * Set chrootDone flag, i.e. has chroot(2) been performed?
572 * @param ts transaction set
573 * @param chrootDone new chrootDone flag
574 * @return previous chrootDone flag
576 int rpmtsSetChrootDone(rpmts ts, int chrootDone)
580 * Get transaction id, i.e. transaction time stamp.
581 * @param ts transaction set
582 * @return chrootDone flag
584 int_32 rpmtsGetTid(rpmts ts)
588 * Set transaction id, i.e. transaction time stamp.
589 * @param ts transaction set
590 * @param tid new transaction id
591 * @return previous transaction id
593 int_32 rpmtsSetTid(rpmts ts, int_32 tid)
598 * @param ts transaction set
599 * @return signature tag
601 int_32 rpmtsSigtag(const rpmts ts)
605 * Get signature tag type.
606 * @param ts transaction set
607 * @return signature tag type
609 int_32 rpmtsSigtype(const rpmts ts)
613 * Get signature tag data, i.e. from header.
614 * @param ts transaction set
615 * @return signature tag data
617 /*@observer@*/ /*@null@*/
618 extern const void * rpmtsSig(const rpmts ts)
622 * Get signature tag data length, i.e. no. of bytes of data.
623 * @param ts transaction set
624 * @return signature tag data length
626 int_32 rpmtsSiglen(const rpmts ts)
630 * Set signature tag info, i.e. from header.
631 * @param ts transaction set
632 * @param sigtag signature tag
633 * @param sigtype signature tag type
634 * @param sig signature tag data
635 * @param siglen signature tag data length
638 int rpmtsSetSig(rpmts ts,
639 int_32 sigtag, int_32 sigtype,
640 /*@kept@*/ /*@null@*/ const void * sig, int_32 siglen)
644 * Get OpenPGP packet parameters, i.e. signature/pubkey constants.
645 * @param ts transaction set
646 * @return signature/pubkey constants.
648 /*@exposed@*/ /*@null@*/
649 pgpDig rpmtsDig(rpmts ts)
653 * Get OpenPGP signature constants.
654 * @param ts transaction set
655 * @return signature constants.
657 /*@exposed@*/ /*@null@*/
658 pgpDigParams rpmtsSignature(const rpmts ts)
662 * Get OpenPGP pubkey constants.
663 * @param ts transaction set
664 * @return pubkey constants.
666 /*@exposed@*/ /*@null@*/
667 pgpDigParams rpmtsPubkey(const rpmts ts)
671 * Get transaction set database handle.
672 * @param ts transaction set
673 * @return transaction database handle
676 rpmdb rpmtsGetRdb(rpmts ts)
680 * Initialize disk space info for each and every mounted file systems.
681 * @param ts transaction set
682 * @return 0 on success
684 int rpmtsInitDSI(const rpmts ts)
685 /*@globals fileSystem, internalState @*/
686 /*@modifies ts, fileSystem, internalState @*/;
689 * Update disk space info for a file.
690 * @param ts transaction set
691 * @param dev mount point device
692 * @param fileSize file size
693 * @param prevSize previous file size (if upgrading)
694 * @param fixupSize size difference (if
695 * @param action file disposition
697 void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
698 uint_32 fileSize, uint_32 prevSize, uint_32 fixupSize,
703 * Check a transaction element for disk space problems.
704 * @param ts transaction set
705 * @param te current transaction element
707 void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
711 * Perform transaction progress notify callback.
712 * @param ts transaction set
713 * @param te current transaction element
714 * @param what type of call back
715 * @param amount current value
716 * @param total final value
717 * @return callback dependent pointer
720 void * rpmtsNotify(rpmts ts, rpmte te,
721 rpmCallbackType what, unsigned long amount, unsigned long total)
725 * Return number of (ordered) transaction set elements.
726 * @param ts transaction set
727 * @return no. of transaction set elements
729 int rpmtsNElements(rpmts ts)
733 * Return (ordered) transaction set element.
734 * @param ts transaction set
735 * @param ix transaction element index
736 * @return transaction element (or NULL)
738 /*@null@*/ /*@dependent@*/
739 rpmte rpmtsElement(rpmts ts, int ix)
743 * Get problem ignore bit mask, i.e. bits to filter encountered problems.
744 * @param ts transaction set
745 * @return ignore bit mask
747 rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
751 * Get transaction flags, i.e. bits that control rpmtsRun().
752 * @param ts transaction set
753 * @return transaction flags
755 rpmtransFlags rpmtsFlags(rpmts ts)
759 * Set transaction flags, i.e. bits that control rpmtsRun().
760 * @param ts transaction set
761 * @param transFlags new transaction flags
762 * @return previous transaction flags
764 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
768 * Get spec control structure from transaction set.
769 * @param ts transaction set
770 * @return spec control structure
773 Spec rpmtsSpec(rpmts ts)
777 * Set a spec control structure in transaction set.
778 * @param ts transaction set
779 * @param spec new spec control structure
780 * @return previous spec control structure
783 Spec rpmtsSetSpec(rpmts ts, /*@null@*/ Spec spec)
787 * Get current relocate transaction element.
788 * @param ts transaction set
789 * @return current relocate transaction element
792 rpmte rpmtsRelocateElement(rpmts ts)
796 * Retrieve color bits of transaction set.
797 * @param ts transaction set
800 uint_32 rpmtsColor(rpmts ts)
804 * Set color bits of transaction set.
805 * @param ts transaction set
806 * @param color new color bits
807 * @return previous color bits
809 uint_32 rpmtsSetColor(rpmts ts, uint_32 color)
813 * Set current relocate transaction element.
814 * @param ts transaction set
815 * @param relocateElement new relocate transaction element
816 * @return previous relocate transaction element
819 rpmte rpmtsSetRelocateElement(rpmts ts, /*@null@*/ rpmte relocateElement)
823 * Set transaction notify callback function and argument.
825 * @warning This call must be made before rpmtsRun() for
826 * install/upgrade/freshen to function correctly.
828 * @param ts transaction set
829 * @param notify progress callback
830 * @param notifyData progress callback private data
831 * @return 0 on success
833 int rpmtsSetNotifyCallback(rpmts ts,
834 /*@observer@*/ rpmCallbackFunction notify,
835 /*@observer@*/ rpmCallbackData notifyData)
839 * Create an empty transaction set.
840 * @return new transaction set
843 rpmts rpmtsCreate(void)
844 /*@globals rpmGlobalMacroContext, internalState @*/
845 /*@modifies rpmGlobalMacroContext, internalState @*/;
848 * Add package to be installed to transaction set.
850 * The transaction set is checked for duplicate package names.
851 * If found, the package with the "newest" EVR will be replaced.
853 * @param ts transaction set
855 * @param key package retrieval key (e.g. file name)
856 * @param upgrade is package being upgraded?
857 * @param relocs package file relocations
858 * @return 0 on success, 1 on I/O error, 2 needs capabilities
860 int rpmtsAddInstallElement(rpmts ts, Header h,
861 /*@exposed@*/ /*@null@*/ const fnpyKey key, int upgrade,
862 /*@null@*/ rpmRelocation * relocs)
863 /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext,
864 fileSystem, internalState @*/
865 /*@modifies ts, h, rpmcliPackagesTotal, rpmGlobalMacroContext,
866 fileSystem, internalState @*/;
869 * Add package to be erased to transaction set.
870 * @param ts transaction set
872 * @param dboffset rpm database instance
873 * @return 0 on success
875 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
876 /*@globals fileSystem @*/
877 /*@modifies ts, h, fileSystem @*/;
880 * Retrieve keys from ordered transaction set.
881 * @todo Removed packages have no keys, returned as interleaved NULL pointers.
882 * @param ts transaction set
883 * @retval ep address of returned element array pointer (or NULL)
884 * @retval nep address of no. of returned elements (or NULL)
888 int rpmtsGetKeys(rpmts ts,
889 /*@null@*/ /*@out@*/ fnpyKey ** ep,
890 /*@null@*/ /*@out@*/ int * nep)
891 /*@globals fileSystem @*/
892 /*@modifies ts, ep, nep, fileSystem @*/;
895 * Return (malloc'd) header name-version-release string.
897 * @retval np name tag value
898 * @return name-version-release string
900 /*@only@*/ char * hGetNEVR(Header h, /*@null@*/ /*@out@*/ const char ** np )
904 * Return header color.
906 * @return header color
908 uint_32 hGetColor(Header h)