1 #ifndef _RPMTS_INTERNAL_H
2 #define _RPMTS_INTERNAL_H
5 #include <rpm/rpmstrpool.h>
7 #include "lib/rpmal.h" /* XXX availablePackage */
8 #include "lib/fprint.h"
9 #include "lib/rpmlock.h"
10 #include "lib/rpmdb_internal.h"
11 #include "lib/rpmscript.h"
12 #include "lib/rpmtriggers.h"
14 typedef struct diskspaceInfo_s * rpmDiskSpaceInfo;
16 /* Transaction set elements information */
17 typedef struct tsMembers_s {
18 rpmstrPool pool; /*!< Global string pool */
19 packageHash removedPackages; /*!< Set of packages being removed. */
20 packageHash installedPackages; /*!< Set of installed packages */
21 rpmal addedPackages; /*!< Set of packages being installed. */
23 rpmds rpmlib; /*!< rpmlib() dependency set. */
24 rpmte * order; /*!< Packages sorted by dependencies. */
25 int orderCount; /*!< No. of transaction elements. */
26 int orderAlloced; /*!< No. of allocated transaction elements. */
27 int delta; /*!< Delta for reallocation. */
30 typedef struct tsTrigger_s {
35 typedef struct tsTriggers_s {
42 * The set of packages to be installed/removed atomically.
45 rpmtransFlags transFlags; /*!< Bit(s) to control operation. */
47 int (*solve) (rpmts ts, rpmds key, const void * data);
48 /*!< Search for NEVRA key. */
49 const void * solveData; /*!< Solve callback data */
51 rpmCallbackFunction notify; /*!< Callback function. */
52 rpmCallbackData notifyData; /*!< Callback private data. */
54 rpmprobFilterFlags ignoreSet;
55 /*!< Bits to filter current problems. */
57 rpmDiskSpaceInfo dsi; /*!< Per filesystem disk/inode usage. */
59 rpmdb rdb; /*!< Install database handle. */
60 int dbmode; /*!< Install database open mode. */
62 tsMembers members; /*!< Transaction set member info (order etc) */
64 char * rootDir; /*!< Path to top of install tree. */
65 char * lockPath; /*!< Transaction lock path */
66 rpmlock lock; /*!< Transaction lock file */
67 FD_t scriptFd; /*!< Scriptlet stdout/stderr. */
68 rpm_tid_t tid; /*!< Transaction id. */
70 rpm_color_t color; /*!< Transaction color bits. */
71 rpm_color_t prefcolor; /*!< Preferred file color. */
73 rpmVSFlags vsflags; /*!< Signature/digest verification flags. */
75 rpmKeyring keyring; /*!< Keyring in use. */
77 ARGV_t netsharedPaths; /*!< From %{_netsharedpath} */
78 ARGV_t installLangs; /*!< From %{_install_langs} */
80 struct rpmop_s ops[RPMTS_OP_MAX];
82 rpmPlugins plugins; /*!< Transaction plugins */
84 int nrefs; /*!< Reference count. */
86 rpmtriggers trigs2run; /*!< Transaction file triggers */
88 int min_writes; /*!< macro minimize_writes used */
96 * Return transaction global string pool handle, creating the pool if needed.
97 * @param ts transaction set
98 * @return string pool handle (weak ref)
101 rpmstrPool rpmtsPool(rpmts ts);
104 tsMembers rpmtsMembers(rpmts ts);
106 /* Return rpmdb iterator with removals optionally pruned out */
108 rpmdbMatchIterator rpmtsPrunedIterator(rpmts ts, rpmDbiTagVal tag,
109 const char * key, int prune);
112 rpmal rpmtsCreateAl(rpmts ts, rpmElementTypes types);
114 /* returns -1 for retry, 0 for ignore and 1 for not found */
116 int rpmtsSolve(rpmts ts, rpmds key);
119 rpmRC rpmtsSetupTransactionPlugins(rpmts ts);
122 rpmRC runScript(rpmts ts, rpmte te, Header h, ARGV_const_t prefixes,
123 rpmScript script, int arg1, int arg2);
128 #endif /* _RPMTS_INTERNAL_H */