rpm  5.4.15
rpmts.h
Go to the documentation of this file.
1 #ifndef H_RPMTS
2 #define H_RPMTS
3 
9 #include <stdio.h> /* XXX FILE * typedef */
10 #include <stdint.h> /* XXX unint32_t typedef */
11 #include <rpmtypes.h>
12 #include <rpmiotypes.h>
13 #include <rpmps.h>
14 #include <rpmsw.h>
15 #include <rpmpgp.h> /* XXX pgpVSFlags */
16 #include <rpmtag.h>
17 #if defined(_RPMTS_INTERNAL)
18 #include <rpmbag.h>
19 #endif
20 
21 /*@-exportlocal@*/
22 /*@unchecked@*/
23 extern int _rpmts_debug;
24 /*@unchecked@*/
25 extern int _rpmts_macros;
26 /*@unchecked@*/
27 extern int _rpmts_stats;
28 /*@unchecked@*/
29 extern int _fps_debug;
30 /*@=exportlocal@*/
31 
36 
41 typedef enum rpmdepFlags_e {
49  RPMDEPS_FLAG_ANACONDA = (1 << 6),
53 } rpmdepFlags;
54 
59 typedef enum rpmtransFlags_e {
61  RPMTRANS_FLAG_TEST = (1 << 0),
64  RPMTRANS_FLAG_JUSTDB = (1 << 3),
66  RPMTRANS_FLAG_NODOCS = (1 << 5),
68  /* 7 unused */
74 /*@-enummemuse@*/
75  RPMTRANS_FLAG_PKGUNDO = (1 << 12),
76 /*@=enummemuse@*/
77  RPMTRANS_FLAG_COMMIT = (1 << 13),
78 /*@-enummemuse@*/
79  RPMTRANS_FLAG_UNDO = (1 << 14),
80 /*@=enummemuse@*/
82 
84  RPMTRANS_FLAG_NOPRE = (1 << 17),
85  RPMTRANS_FLAG_NOPOST = (1 << 18),
88  RPMTRANS_FLAG_NOPREUN = (1 << 21),
89  RPMTRANS_FLAG_NOPOSTUN = (1 << 22),
91 /*@-enummemuse@*/
93 /*@=enummemuse@*/
94  RPMTRANS_FLAG_NORPMDB = (1 << 25),
95  RPMTRANS_FLAG_NOPOLICY = (1 << 26),
100  /* 31 unused */
101 } rpmtransFlags;
102 
103 #define _noTransScripts \
104  ( RPMTRANS_FLAG_NOPRETRANS | \
105  RPMTRANS_FLAG_NOPRE | \
106  RPMTRANS_FLAG_NOPOST | \
107  RPMTRANS_FLAG_NOPREUN | \
108  RPMTRANS_FLAG_NOPOSTUN | \
109  RPMTRANS_FLAG_NOPOSTTRANS \
110  )
111 
112 #define _noTransTriggers \
113  ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
114  RPMTRANS_FLAG_NOTRIGGERIN | \
115  RPMTRANS_FLAG_NOTRIGGERUN | \
116  RPMTRANS_FLAG_NOTRIGGERPOSTUN \
117  )
118 
122 typedef enum rpmtsOpX_e {
145 } rpmtsOpX;
146 
150 typedef enum rpmTSType_e {
154 } rpmTSType;
155 
158 typedef enum tsStage_e {
162 } tsmStage;
163 
164 #if defined(_RPMTS_INTERNAL)
165 
166 #include <rpmbf.h>
167 #include "rpmhash.h" /* XXX hashTable */
168 #include "rpmkeyring.h"
169 #include <rpmtxn.h>
170 #include "rpmal.h" /* XXX availablePackage/relocateFileList ,*/
171 
172 /*@unchecked@*/
173 /*@-exportlocal@*/
174 extern int _cacheDependsRC;
175 /*@=exportlocal@*/
176 
179 typedef /*@abstract@*/ struct diskspaceInfo_s * rpmDiskSpaceInfo;
180 
184 struct diskspaceInfo_s {
185  unsigned long f_bsize;
186  unsigned long f_frsize;
187  unsigned long long f_blocks;
188  unsigned long long f_bfree;
189  signed long long f_bavail;
190  unsigned long long f_files;
191  unsigned long long f_ffree;
192  signed long long f_favail;
193  unsigned long f_fsid;
194  unsigned long f_flag;
195  unsigned long f_namemax;
197  signed long long bneeded;
198  signed long long ineeded;
199  signed long long obneeded;
200  signed long long oineeded;
201  dev_t dev;
202 };
203 
207 #define adj_fs_blocks(_nb) (((_nb) * 21) / 20)
208 
209 #define BLOCK_ROUND(size, block) (((size) + (block) - 1) / (block))
210 
214 struct rpmts_s {
215  struct rpmioItem_s _item;
216  rpmdepFlags depFlags;
217  rpmtransFlags transFlags;
218  tsmStage goal;
219  rpmTSType type;
221 /*@refcounted@*/ /*@null@*/
222  rpmbag bag;
223 /*@null@*/
224  int (*solve) (rpmts ts, rpmds key, const void * data)
225  /*@modifies ts @*/;
226 /*@relnull@*/
227  const void * solveData;
228  int nsuggests;
229 /*@only@*/ /*@null@*/
230  const void ** suggests;
232 /*@observer@*/ /*@null@*/
233  rpmCallbackFunction notify;
234 /*@observer@*/ /*@null@*/
235  rpmCallbackData notifyData;
237 /*@null@*/
238  rpmPRCO PRCO;
240 /*@refcounted@*/ /*@null@*/
241  rpmps probs;
242  rpmprobFilterFlags ignoreSet;
245  rpmuint32_t filesystemCount;
246 /*@dependent@*/ /*@null@*/
247  const char ** filesystems;
248 /*@only@*/ /*@relnull@*/
249  rpmDiskSpaceInfo dsi;
251 /*@refcounted@*/ /*@null@*/
252  rpmdb rdb;
253  int dbmode;
254 /*@only@*/
255  hashTable ht;
256 /*@null@*/
257  rpmtxn txn;
259 /*@refcounted@*/ /*@null@*/
260  rpmbf rbf;
261 /*@only@*/ /*@null@*/
262  uint32_t * removedPackages;
263  int numRemovedPackages;
264  int allocedRemovedPackages;
266 /*@only@*/
267  rpmal addedPackages;
268  int numAddedPackages;
269  int numAddedFiles;
271 /*@only@*/
272  rpmal erasedPackages;
273  int numErasedPackages;
274  int numErasedFiles;
276 #ifndef DYING
277 /*@only@*/
278  rpmal availablePackages;
279  int numAvailablePackages;
280 #endif
281 
282 /*@null@*/
283  rpmte relocateElement;
285 /*@owned@*/ /*@relnull@*/
286  rpmte * order;
287  int orderCount;
288  int orderAlloced;
289  int unorderedSuccessors;
290  int ntrees;
291  int maxDepth;
293 /*@dependent@*/ /*@relnull@*/
294  rpmte teInstall;
295 /*@dependent@*/ /*@relnull@*/
296  rpmte teErase;
298  int selinuxEnabled;
299  int chrootDone;
300 /*@only@*/ /*@null@*/
301  const char * rootDir;
302 /*@only@*/ /*@null@*/
303  const char * currDir;
304 /*@null@*/
305  FD_t scriptFd;
306  int delta;
307  rpmuint32_t tid[2];
309  rpmuint32_t color;
310  rpmuint32_t prefcolor;
312 /*@observer@*/ /*@dependent@*/ /*@null@*/
313  const char * fn;
315 /*@refcounted@*/ /*@relnull@*/
316  rpmKeyring keyring;
317 /*@relnull@*/
318  void * hkp;
320  struct rpmop_s ops[RPMTS_OP_MAX];
321 
322 /*@refcounted@*/ /*@relnull@*/
323  pgpDig dig;
325 /*@null@*/
326  Spec spec;
328  rpmuint32_t arbgoal;
330 #if defined(__LCLINT__)
331 /*@refs@*/
332  int nrefs;
333 #endif
334 };
335 #endif /* _RPMTS_INTERNAL */
336 
337 #ifdef __cplusplus
338 extern "C" {
339 #endif
340 
351 extern int (*rpmtsCheck) (rpmts ts)
352  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
353  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
354 int _rpmtsCheck(rpmts ts)
355  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
356  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
357 
374 extern int (*rpmtsOrder) (rpmts ts)
375  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
376  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
377 int _rpmtsOrder(rpmts ts)
378  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
379  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
381  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
382  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
383 
401 extern int (*rpmtsRun) (rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
402  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
403  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
404 int _rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
405  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
406  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
407 
417  int running, rpmte rbte)
418  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
419  /*@modifies rbts, rbte, rpmGlobalMacroContext, fileSystem, internalState @*/;
420 
427 /*@unused@*/ /*@null@*/
428 rpmts rpmtsUnlink (/*@killref@*/ /*@only@*/ rpmts ts,
429  const char * msg)
430  /*@modifies ts @*/;
431 #define rpmtsUnlink(_ts, _msg) \
432  ((rpmts) rpmioUnlinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE__))
433 
440 /*@unused@*/ /*@newref@*/
441 rpmts rpmtsLink (rpmts ts, const char * msg)
442  /*@modifies ts @*/;
443 #define rpmtsLink(_ts, _msg) \
444  ((rpmts) rpmioLinkPoolItem((rpmioItem)(_ts), _msg, __FILE__, __LINE__))
445 
451 int rpmtsCloseDB(rpmts ts)
452  /*@globals fileSystem @*/
453  /*@modifies ts, fileSystem @*/;
454 
461 int rpmtsOpenDB(rpmts ts, int dbmode)
462  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
463  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
464 
472 static inline /*@unused@*/
473 int rpmtsInitDB(/*@unused@*/ rpmts ts, /*@unused@*/ int dbmode)
474  /*@*/
475 {
476  return -1;
477 }
478 
484 int rpmtsRebuildDB(rpmts ts)
485  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
486  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
487 
494 static inline /*@unused@*/
495 int rpmtsVerifyDB(/*@unused@*/ rpmts ts)
496  /*@*/
497 {
498  return -1;
499 }
500 
509 /*@only@*/ /*@null@*/
510 rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag,
511  /*@null@*/ const void * keyp, size_t keylen)
512  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
513  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
514 
521 /*@-exportlocal@*/
522 rpmRC rpmtsFindPubkey(rpmts ts, /*@null@*/ void * _dig)
523  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
524  /*@modifies ts, _dig, rpmGlobalMacroContext, fileSystem, internalState */;
525 /*@=exportlocal@*/
526 
532 /*@-exportlocal@*/
533 int rpmtsCloseSDB(rpmts ts)
534  /*@globals fileSystem @*/
535  /*@modifies ts, fileSystem @*/;
536 /*@=exportlocal@*/
537 
544 /*@-exportlocal@*/
545 int rpmtsOpenSDB(rpmts ts, int dbmode)
546  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
547  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
548 /*@=exportlocal@*/
549 
557 /*@-exportlocal@*/
558 int rpmtsSolve(rpmts ts, rpmds ds, const void * data)
559  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
560  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
561 /*@=exportlocal@*/
562 
570 /*@unused@*/
571 int rpmtsAvailable(rpmts ts, const rpmds ds)
572  /*@globals fileSystem, internalState @*/
573  /*@modifies ts, fileSystem, internalState @*/;
574 
583  int (*solve) (rpmts ts, rpmds ds, const void * data),
584  const void * solveData)
585  /*@modifies ts @*/;
586 
593  /*@*/;
594 
606  /*@modifies ts @*/;
607 
614  /*@*/;
615 
621 void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal)
622  /*@modifies ts @*/;
623 
629 /*@null@*/
631  /*@modifies ts @*/;
632 
637 void rpmtsCleanDig(rpmts ts)
638  /*@globals fileSystem @*/
639  /*@modifies ts, fileSystem @*/;
640 
645 void rpmtsClean(rpmts ts)
646  /*@globals fileSystem, internalState @*/
647  /*@modifies ts, fileSystem , internalState@*/;
648 
653 void rpmtsEmpty(rpmts ts)
654  /*@globals fileSystem, internalState @*/
655  /*@modifies ts, fileSystem, internalState @*/;
656 
662 /*@null@*/
663 rpmts rpmtsFree(/*@killref@*/ /*@null@*/ rpmts ts)
664  /*@globals fileSystem, internalState @*/
665  /*@modifies ts, fileSystem, internalState @*/;
666 #define rpmtsFree(_ts) \
667  ((rpmts) rpmioFreePoolItem((rpmioItem)(_ts), __FUNCTION__, __FILE__, __LINE__))
668 
675 void * rpmtsGetKeyring(rpmts ts, int autoload)
676  /*@*/;
677 
684 int rpmtsSetKeyring(rpmts ts, void * _keyring)
685  /*modifies ts, _keyring @*/;
686 
693  /*@*/;
694 
702  /*@modifies ts @*/;
703 
710 int rpmtsUnorderedSuccessors(rpmts ts, int first)
711  /*@modifies ts @*/;
712 
718 /*@observer@*/ /*@null@*/
719 extern const char * rpmtsRootDir(rpmts ts)
720  /*@*/;
721 
727 void rpmtsSetRootDir(rpmts ts, /*@null@*/ const char * rootDir)
728  /*@modifies ts @*/;
729 
735 /*@observer@*/ /*@null@*/
736 extern const char * rpmtsCurrDir(rpmts ts)
737  /*@*/;
738 
744 void rpmtsSetCurrDir(rpmts ts, /*@null@*/ const char * currDir)
745  /*@modifies ts @*/;
746 
747 #if defined(_RPMTS_INTERNAL) /* XXX avoid FD_t in API. */
748 
753 /*@null@*/
755  /*@*/;
756 
762 void rpmtsSetScriptFd(rpmts ts, /*@null@*/ FD_t scriptFd)
763  /*@globals fileSystem @*/
764  /*@modifies ts, scriptFd, fileSystem @*/;
765 #endif
766 
773  /*@*/;
774 
780 int rpmtsChrootDone(rpmts ts)
781  /*@*/;
782 
789 int rpmtsSetChrootDone(rpmts ts, int chrootDone)
790  /*@modifies ts @*/;
791 
798  /*@*/;
799 
807  /*@modifies ts @*/;
808 
815  /*@globals fileSystem @*/
816  /*@modifies fileSystem @*/;
817 
823 /*@-exportlocal@*/
824 /*@exposed@*/ /*@null@*/
826  /*@globals fileSystem @*/
827  /*@modifies fileSystem @*/;
828 /*@=exportlocal@*/
829 
835 /*@null@*/
837  /*@*/;
838 
844 /*@null@*/
846  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
847  /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/;
848 
854 int rpmtsInitDSI(const rpmts ts)
855  /*@globals fileSystem, internalState @*/
856  /*@modifies ts, fileSystem, internalState @*/;
857 
867 void rpmtsUpdateDSI(const rpmts ts, dev_t dev,
868  rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixupSize,
869  int _action)
870  /*@modifies ts @*/;
871 
877 void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
878  /*@modifies ts @*/;
879 
891 /*@null@*/
892 void * rpmtsNotify(rpmts ts, rpmte te,
893  rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total)
894  /*@modifies te @*/;
895 
901 int rpmtsNElements(rpmts ts)
902  /*@*/;
903 
910 /*@null@*/ /*@dependent@*/
911 rpmte rpmtsElement(rpmts ts, int ix)
912  /*@*/;
913 
920  /*@*/;
921 
928  /*@*/;
929 
937  /*@modifies ts @*/;
938 
945  /*@*/;
946 
954  /*@modifies ts @*/;
955 
961 /*@null@*/
962 Spec rpmtsSpec(rpmts ts)
963  /*@*/;
964 
971 /*@null@*/
972 Spec rpmtsSetSpec(rpmts ts, /*@null@*/ Spec spec)
973  /*@modifies ts @*/;
974 
980 /*@null@*/
982  /*@*/;
983 
990 /*@null@*/
991 rpmte rpmtsSetRelocateElement(rpmts ts, /*@null@*/ rpmte relocateElement)
992  /*@modifies ts @*/;
993 
1000  /*@*/;
1001 
1009  /*@modifies ts @*/;
1010 
1016 int rpmtsDBMode(rpmts ts)
1017  /*@*/;
1018 
1025 int rpmtsSetDBMode(rpmts ts, int dbmode)
1026  /*@modifies ts @*/;
1027 
1034  /*@*/;
1035 
1042  /*@*/;
1043 
1051  /*@modifies ts @*/;
1052 
1059 /*@relnull@*/
1060 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
1061  /*@*/;
1062 
1075  /*@observer@*/ rpmCallbackFunction notify,
1076  /*@observer@*/ rpmCallbackData notifyData)
1077  /*@modifies ts @*/;
1078 
1083 /*@newref@*/
1084 rpmts rpmtsCreate(void)
1085  /*@globals rpmGlobalMacroContext, h_errno, internalState @*/
1086  /*@modifies rpmGlobalMacroContext, internalState @*/;
1087 
1088 /*@-redecl@*/
1089 /*@unchecked@*/
1090 extern int rpmcliPackagesTotal;
1091 /*@=redecl@*/
1092 
1107  /*@exposed@*/ /*@null@*/ const fnpyKey key, int upgrade,
1108  /*@null@*/ rpmRelocation relocs)
1109  /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno,
1110  fileSystem, internalState @*/
1111  /*@modifies ts, h, rpmcliPackagesTotal, rpmGlobalMacroContext,
1112  fileSystem, internalState @*/;
1113 
1121 int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum)
1122  /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
1123  /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/;
1124 
1125 #if !defined(SWIG)
1126 #if defined(_RPMTS_PRINT)
1127 
1133 /*@unused@*/ static inline
1134 int rpmtsPrint(/*@null@*/ rpmts ts, /*@null@*/ FILE * fp)
1135  /*@globals fileSystem @*/
1136  /*@modifies ts, *fp, fileSystem @*/
1137 {
1138  rpmuint32_t tid = rpmtsGetTid(ts);
1139  time_t ttid = tid;
1140  rpmtsi tsi;
1141  rpmte te;
1142 
1143  if (fp == NULL)
1144  fp = stderr;
1145 
1146  fprintf(fp, _("=== Transaction at %-24.24s (0x%08x):\n"), ctime(&ttid),tid);
1147  tsi = rpmtsiInit(ts);
1148  while ((te = rpmtsiNext(tsi, (rpmElementType)0)) != NULL)
1149  fprintf(fp, "t%s> %s\n", (rpmteType(te) == TR_ADDED ? "I" : "E"),
1150  rpmteNEVRA(te));
1151  tsi = rpmtsiFree(tsi);
1152  return 0;
1153 }
1154 #endif /* defined(_RPMTS_PRINT) */
1155 #endif /* !defined(SWIG) */
1156 
1157 #ifdef __cplusplus
1158 }
1159 #endif
1160 
1161 
1162 #endif /* H_RPMTS */
rpmdepFlags_e
Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
Definition: rpmts.h:41
int _rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
Definition: transaction.c:2160
int _rpmts_debug
Definition: rpmts.c:93
int rpmtsSetDBMode(rpmts ts, int dbmode)
Set dbmode of transaction set.
Definition: rpmts.c:1430
int rpmtsAddEraseElement(rpmts ts, Header h, uint32_t hdrNum)
Add package to be erased to transaction set.
Definition: depends.c:834
static struct fsinfo * filesystems
Definition: fs.c:31
const char bson_timestamp_t * ts
Definition: bson.h:1004
void rpmtsSetType(rpmts ts, rpmTSType type)
Set transaction type.
Definition: rpmts.c:875
OpenPGP constants and structures from RFC-2440.
#define rpmtsUnlink(_ts, _msg)
Definition: rpmts.h:431
int rpmcliPackagesTotal
Definition: rpminstall.c:63
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
Definition: rpmts.c:584
struct pgpDigParams_s * pgpDigParams
Definition: rpmiotypes.h:101
int rpmtsInitDSI(const rpmts ts)
Initialize disk space info for each and every mounted file systems.
Definition: rpmts.c:1067
enum rpmprobFilterFlags_e rpmprobFilterFlags
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
Definition: rpmts.c:101
struct rpmbf_s * rpmbf
Definition: rpmbf.h:17
rpmte rpmtsRelocateElement(rpmts ts)
Get current relocate transaction element.
Definition: rpmts.c:1394
rpmuint32_t rpmtsGetTid(rpmts ts)
Get transaction id, i.e.
Definition: rpmts.c:1024
tsmStage rpmtsSetGoal(rpmts ts, tsmStage goal)
Set goal of transaction set.
Definition: rpmts.c:1415
rpmuint32_t rpmtsSetColor(rpmts ts, rpmuint32_t color)
Set color bits of transaction set.
Definition: rpmts.c:1445
The Header data structure.
Spec rpmtsSetSpec(rpmts ts, Spec spec)
Set a spec control structure in transaction set.
Definition: rpmts.c:1385
static int rpmtsVerifyDB(rpmts ts)
Verify the database used by the transaction.
Definition: rpmts.h:495
#define rpmtsFree(_ts)
Definition: rpmts.h:666
static rpmVSFlags vsflags
Definition: rpmcache.c:547
Definition: rpmdb.c:436
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpmuint64_t amount, rpmuint64_t total)
Perform transaction progress notify callback.
Definition: rpmts.c:1281
Hash table implemenation.
enum rpmTSType_e rpmTSType
Transaction Types.
int rpmtsOpenSDB(rpmts ts, int dbmode)
Open the database used by the transaction to solve dependencies.
Definition: rpmts.c:252
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
Definition: pkgio.c:133
int rpmtsAvailable(rpmts ts, const rpmds ds)
Attempt to solve a needed dependency using memory resident tables.
Definition: rpmts.c:545
enum rpmtsOpX_e rpmtsOpX
Indices for timestamps.
int rpmtsCloseSDB(rpmts ts)
Close the database used by the transaction to solve dependencies.
Definition: rpmts.c:222
int rpmtsUnorderedSuccessors(rpmts ts, int first)
Set index of 1st element of successors.
Definition: rpmts.c:892
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
struct rpmtsi_s * rpmtsi
Transaction element iterator.
Definition: rpmte.h:31
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
Set dependency solver callback.
struct rpmps_s * rpmps
Transaction problems found while processing a transaction set/.
Definition: rpmps.h:25
rpmElementType rpmteType(rpmte te)
Retrieve type of transaction element.
Definition: rpmte.c:311
rpmRC rpmtsRollback(rpmts rbts, rpmprobFilterFlags ignoreSet, int running, rpmte rbte)
Rollback a failed transaction.
Definition: transaction.c:2025
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
Definition: rpmts.c:903
struct rpmds_s * rpmds
Dependency tag sets from a header, so that a header can be discarded early.
Definition: rpmtypes.h:28
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
Definition: rpmts.c:115
struct rpmPRCO_s * rpmPRCO
Container for commonly extracted dependency set(s).
Definition: rpmtypes.h:33
struct rpmte_s * rpmte
An element of a transaction set, i.e.
Definition: rpmtypes.h:38
int rpmtsSetChrootDone(rpmts ts, int chrootDone)
Set chrootDone flag, i.e.
Definition: rpmts.c:1012
int _cacheDependsRC
Definition: depends.c:39
rpmdepFlags rpmtsSetDFlags(rpmts ts, rpmdepFlags depFlags)
Set dependency flags, i.e.
Definition: rpmts.c:1368
rpmTSType rpmtsType(rpmts ts)
Return the type of a transaction.
Definition: rpmts.c:870
enum rpmElementType_e rpmElementType
Transaction element type.
void rpmtsEmpty(rpmts ts)
Re-create an empty transaction set.
Definition: rpmts.c:625
int rpmtsChrootDone(rpmts ts)
Get chrootDone flag, i.e.
Definition: rpmts.c:1007
int _rpmtsCheck(rpmts ts)
Definition: depends.c:1908
unsigned int rpmuint32_t
Definition: rpmiotypes.h:28
void rpmtsCleanDig(rpmts ts)
Free signature verification data.
Definition: pkgio.c:456
struct rpmop_s ops[FDSTAT_MAX]
int _rpmts_stats
Definition: rpmts.c:96
Structures and prototypes used for an "rpmps" problem set.
void *(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpmuint64_t amount, const rpmuint64_t total, fnpyKey key, rpmCallbackData data)
Definition: rpmiotypes.h:528
const char * rpmtsCurrDir(rpmts ts)
Get transaction currDir, i.e.
Definition: rpmts.c:953
rpmte rpmtsSetRelocateElement(rpmts ts, rpmte relocateElement)
Set current relocate transaction element.
Definition: rpmts.c:1401
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
Definition: rpmts.c:1334
int _fps_debug
Definition: transaction.c:232
const char const bson * data
Definition: mongo.h:463
static int rpmtsInitDB(rpmts ts, int dbmode)
Initialize the database used by the transaction.
Definition: rpmts.h:473
enum rpmdepFlags_e rpmdepFlags
Bit(s) to control rpmtsCheck() and rpmtsOrder() operation.
unsigned long long rpmuint64_t
Definition: rpmiotypes.h:29
int rpmtsSetKeyring(rpmts ts, void *_keyring)
Set transaction keyring.
Definition: rpmts.c:809
enum pgpVSFlags_e pgpVSFlags
Bit(s) to control digest and signature verification.
Set of available packages, items, and directories.
Definition: rpmal.c:90
void * rpmtsGetKeyring(rpmts ts, int autoload)
Get transaction keyring.
Definition: rpmts.c:792
enum tsStage_e tsmStage
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
Get problem ignore bit mask, i.e.
Definition: rpmts.c:1329
The FD_t File Handle data structure.
struct pgpDig_s * pgpDig
Definition: rpmiotypes.h:97
struct rpmdb_s * rpmdb
Database of headers and tag value indices.
Definition: rpmtypes.h:43
int _orgrpmtsOrder(rpmts ts)
Definition: order.c:1568
const char * rpmteNEVRA(rpmte te)
Retrieve name-version-release.arch string from transaction element.
Definition: rpmte.c:541
The structure used to store values parsed from a spec file.
Definition: rpmspec.h:113
pgpVSFlags rpmVSFlags
Bit(s) to control digest and signature verification.
Definition: rpmts.h:35
rpmte rpmtsElement(rpmts ts, int ix)
Return (ordered) transaction set element.
Definition: rpmts.c:1317
rpmuint32_t rpmtsPrefColor(rpmts ts)
Retrieve preferred file color.
Definition: rpmts.c:1455
rpmRC rpmtsFindPubkey(rpmts ts, void *_dig)
Retrieve pubkey from rpm database.
Definition: pkgio.c:162
rpmuint32_t rpmtsSetTid(rpmts ts, rpmuint32_t tid)
Set transaction id, i.e.
Definition: rpmts.c:1033
int(* rpmtsCheck)(rpmts ts)
Perform dependency resolution on the transaction set.
Definition: depends.c:2097
rpmmi rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
Definition: rpmts.c:212
Cumulative statistics for an operation.
Definition: rpmsw.h:39
int rpmtsDBMode(rpmts ts)
Retrieve dbmode of transaction set.
Definition: rpmts.c:1425
rpmte rpmtsiNext(rpmtsi tsi, rpmElementType type)
Return next transaction element of type.
Definition: rpmte.c:831
void rpmtsUpdateDSI(const rpmts ts, dev_t dev, rpmuint32_t fileSize, rpmuint32_t prevSize, rpmuint32_t fixupSize, int _action)
Update disk space info for a file.
Definition: rpmts.c:1181
int(* rpmtsOrder)(rpmts ts)
Determine package order in a transaction set according to dependencies.
Definition: order.c:2311
void * rpmCallbackData
Definition: rpmiotypes.h:162
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
Definition: pkgio.c:151
rpmuint32_t rpmtsARBGoal(rpmts ts)
Return the autorollback goal.
Definition: rpmts.c:881
void rpmtsSetCurrDir(rpmts ts, const char *currDir)
Set transaction currDir, i.e.
Definition: rpmts.c:962
enum rpmRC_e rpmRC
RPM return codes.
void * rpmtxn
Definition: rpmtxn.h:14
Definition: rpmte.h:37
int rpmtsSolve(rpmts ts, rpmds ds, const void *data)
Attempt to solve a needed dependency using the solve database.
Definition: rpmts.c:351
int rpmtsNElements(rpmts ts)
Return number of (ordered) transaction set elements.
Definition: rpmts.c:1308
const char const bson * key
Definition: mongo.h:717
enum rpmtransFlags_e rpmtransFlags
Bit(s) to control rpmtsRun() operation.
int _rpmts_macros
Definition: rpmts.c:99
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
Definition: rpmts.c:845
void rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
Definition: rpmts.c:927
struct rpmts_s * rpmts
The RPM Transaction Set.
Definition: rpmtypes.h:14
rpmPRCO rpmtsPRCO(rpmts ts)
Get transaction set dependencies.
Definition: rpmts.c:1044
tsStage_e
Definition: rpmts.h:158
const void * fnpyKey
Definition: rpmiotypes.h:134
int(* rpmtsRun)(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
Process all package elements in a transaction set.
Definition: transaction.c:2307
rpmtransFlags_e
Bit(s) to control rpmtsRun() operation.
Definition: rpmts.h:59
Spec rpmtsSpec(rpmts ts)
Get spec control structure from transaction set.
Definition: rpmts.c:1378
const char char type
Definition: bson.h:908
rpmtsOpX_e
Indices for timestamps.
Definition: rpmts.h:122
void rpmtsCheckDSIProblems(const rpmts ts, const rpmte te)
Check a transaction element for disk space problems.
Definition: rpmts.c:1232
rpmVSFlags rpmtsVSFlags(rpmts ts)
Get verify signatures flag(s).
Definition: rpmts.c:840
Structures used for managing added/available package lists.
void rpmtsSetARBGoal(rpmts ts, rpmuint32_t goal)
Set autorollback goal.
Definition: rpmts.c:886
#define _(Text)
Definition: system.h:29
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
Definition: rpmts.c:136
int _rpmtsOrder(rpmts ts)
Definition: order.c:1777
rpmTSType_e
Transaction Types.
Definition: rpmts.h:150
void rpmtsClean(rpmts ts)
Free memory needed only for dependency checks and ordering.
Definition: rpmts.c:598
Database transaction wrappers.
rpmdepFlags rpmtsDFlags(rpmts ts)
Get dependency flags, i.e.
Definition: rpmts.c:1363
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation relocs)
Add package to be installed to transaction set.
Definition: depends.c:547
enum rpmTag_e rpmTag
Definition: rpmtag.h:470
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
Set transaction flags, i.e.
Definition: rpmts.c:1347
rpmts rpmtsCreate(void)
Create an empty transaction set.
Definition: rpmts.c:1470
rpmuint32_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
Definition: rpmts.c:1440
pgpDig rpmtsDig(rpmts ts)
Get OpenPGP packet parameters, i.e.
Definition: pkgio.c:441
pgpDigParams rpmtsPubkey(const rpmts ts)
Return OpenPGP pubkey constants.
Definition: pkgio.c:144
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
Set transaction notify callback function and argument.
Definition: rpmts.c:1460
int rpmtsSELinuxEnabled(rpmts ts)
Get selinuxEnabled flag, i.e.
Definition: rpmts.c:999
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
Definition: rpmts.c:982
FD_t rpmtsScriptFd(rpmts ts)
Definition: rpmts.c:971
tsmStage rpmtsGoal(rpmts ts)
Retrieve goal of transaction set.
Definition: rpmts.c:1410
#define rpmtsLink(_ts, _msg)
Definition: rpmts.h:443
struct rpmbag_s * rpmbag
Definition: rpmbag.h:15