rpm: rpmts.h Source File

rpm 4.11.2-rc1

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

rpmts.h
Go to the documentation of this file.
1 #ifndef H_RPMTS
2 #define H_RPMTS
3
9 #include <sys/types.h>
10
11 #include <rpm/rpmtypes.h>
12 #include <rpm/rpmte.h>
13 #include <rpm/rpmps.h>
14 #include <rpm/rpmsw.h>
15 #include <rpm/rpmpgp.h>
16 #include <rpm/rpmfi.h>
17 #include <rpm/rpmcallback.h>
18
19 #ifdef __cplusplus
20 extern "C" {
21 #endif
22
23 extern int _rpmts_stats;
24
28 enum rpmtransFlags_e {
29 RPMTRANS_FLAG_NONE = 0,
30 RPMTRANS_FLAG_TEST = (1 << 0),
31 RPMTRANS_FLAG_BUILD_PROBS = (1 << 1),
32 RPMTRANS_FLAG_NOSCRIPTS = (1 << 2),
33 RPMTRANS_FLAG_JUSTDB = (1 << 3),
34 RPMTRANS_FLAG_NOTRIGGERS = (1 << 4),
35 RPMTRANS_FLAG_NODOCS = (1 << 5),
36 RPMTRANS_FLAG_ALLFILES = (1 << 6),
37 /* bit 7 unused */
38 RPMTRANS_FLAG_NOCONTEXTS = (1 << 8),
39 /* bits 9-15 unused */
40 RPMTRANS_FLAG_NOTRIGGERPREIN= (1 << 16),
41 RPMTRANS_FLAG_NOPRE = (1 << 17),
42 RPMTRANS_FLAG_NOPOST = (1 << 18),
43 RPMTRANS_FLAG_NOTRIGGERIN = (1 << 19),
44 RPMTRANS_FLAG_NOTRIGGERUN = (1 << 20),
45 RPMTRANS_FLAG_NOPREUN = (1 << 21),
46 RPMTRANS_FLAG_NOPOSTUN = (1 << 22),
47 RPMTRANS_FLAG_NOTRIGGERPOSTUN = (1 << 23),
48 /* bits 24-25 unused */
49 RPMTRANS_FLAG_NOCOLLECTIONS = (1 << 26),
50 RPMTRANS_FLAG_NOMD5 = (1 << 27),
51 RPMTRANS_FLAG_NOFILEDIGEST = (1 << 27),
52 /* bits 28-29 unused */
53 RPMTRANS_FLAG_NOCONFIGS = (1 << 30),
54 RPMTRANS_FLAG_DEPLOOPS = (1 << 31)
55 };
56
57 typedef rpmFlags rpmtransFlags;
58
59 #define _noTransScripts \
60 ( RPMTRANS_FLAG_NOPRE | \
61 RPMTRANS_FLAG_NOPOST | \
62 RPMTRANS_FLAG_NOPREUN | \
63 RPMTRANS_FLAG_NOPOSTUN \
64 )
65
66 #define _noTransTriggers \
67 ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
68 RPMTRANS_FLAG_NOTRIGGERIN | \
69 RPMTRANS_FLAG_NOTRIGGERUN | \
70 RPMTRANS_FLAG_NOTRIGGERPOSTUN \
71 )
72
73 /* Avoid unnecessary breakage for stuff referring to these unused flags */
74 #define RPMTRANS_FLAG_NOPAYLOAD 0
75 #define RPMTRANS_FLAG_APPLYONLY 0
76 #define RPMTRANS_FLAG_KEEPOBSOLETE 0
77 #define RPMTRANS_FLAG_DIRSTASH 0
78 #define RPMTRANS_FLAG_REPACKAGE 0
79 #define RPMTRANS_FLAG_PKGCOMMIT 0
80 #define RPMTRANS_FLAG_PKGUNDO 0
81 #define RPMTRANS_FLAG_COMMIT 0
82 #define RPMTRANS_FLAG_UNDO 0
83 #define RPMTRANS_FLAG_REVERSE 0
84 #define RPMTRANS_FLAG_NOSUGGEST 0
85 #define RPMTRANS_FLAG_ADDINDEPS 0
86
90 enum rpmVSFlags_e {
91 RPMVSF_DEFAULT = 0,
92 RPMVSF_NOHDRCHK = (1 << 0),
93 RPMVSF_NEEDPAYLOAD = (1 << 1),
94 /* bit(s) 2-7 unused */
95 RPMVSF_NOSHA1HEADER = (1 << 8),
96 RPMVSF_NOMD5HEADER = (1 << 9), /* unimplemented */
97 RPMVSF_NODSAHEADER = (1 << 10),
98 RPMVSF_NORSAHEADER = (1 << 11), /* unimplemented */
99 /* bit(s) 12-15 unused */
100 RPMVSF_NOSHA1 = (1 << 16), /* unimplemented */
101 RPMVSF_NOMD5 = (1 << 17),
102 RPMVSF_NODSA = (1 << 18),
103 RPMVSF_NORSA = (1 << 19)
104 /* bit(s) 16-31 unused */
105 };
106
107 typedef rpmFlags rpmVSFlags;
108
109 #define _RPMVSF_NODIGESTS \
110 ( RPMVSF_NOSHA1HEADER | \
111 RPMVSF_NOMD5HEADER | \
112 RPMVSF_NOSHA1 | \
113 RPMVSF_NOMD5 )
114
115 #define _RPMVSF_NOSIGNATURES \
116 ( RPMVSF_NODSAHEADER | \
117 RPMVSF_NORSAHEADER | \
118 RPMVSF_NODSA | \
119 RPMVSF_NORSA )
120
121 #define _RPMVSF_NOHEADER \
122 ( RPMVSF_NOSHA1HEADER | \
123 RPMVSF_NOMD5HEADER | \
124 RPMVSF_NODSAHEADER | \
125 RPMVSF_NORSAHEADER )
126
127 #define _RPMVSF_NOPAYLOAD \
128 ( RPMVSF_NOSHA1 | \
129 RPMVSF_NOMD5 | \
130 RPMVSF_NODSA | \
131 RPMVSF_NORSA )
132
136 typedef enum rpmtsOpX_e {
137 RPMTS_OP_TOTAL = 0,
138 RPMTS_OP_CHECK = 1,
139 RPMTS_OP_ORDER = 2,
140 RPMTS_OP_FINGERPRINT = 3,
141 RPMTS_OP_INSTALL = 5,
142 RPMTS_OP_ERASE = 6,
143 RPMTS_OP_SCRIPTLETS = 7,
144 RPMTS_OP_COMPRESS = 8,
145 RPMTS_OP_UNCOMPRESS = 9,
146 RPMTS_OP_DIGEST = 10,
147 RPMTS_OP_SIGNATURE = 11,
148 RPMTS_OP_DBADD = 12,
149 RPMTS_OP_DBREMOVE = 13,
150 RPMTS_OP_DBGET = 14,
151 RPMTS_OP_DBPUT = 15,
152 RPMTS_OP_DBDEL = 16,
153 RPMTS_OP_MAX = 17
154 } rpmtsOpX;
155
166 int rpmtsCheck(rpmts ts);
167
184 int rpmtsOrder(rpmts ts);
185
203 int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
204
210 rpmts rpmtsLink (rpmts ts);
211
217 int rpmtsCloseDB(rpmts ts);
218
225 int rpmtsOpenDB(rpmts ts, int dbmode);
226
234 int rpmtsInitDB(rpmts ts, int dbmode);
235
241 int rpmtsGetDBMode(rpmts ts);
242
250 int rpmtsSetDBMode(rpmts ts, int dbmode);
251
257 int rpmtsRebuildDB(rpmts ts);
258
264 int rpmtsVerifyDB(rpmts ts);
265
274 rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
275 const void * keyp, size_t keylen);
276
285 rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
286
293 rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
294
303 int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
304
312 int rpmtsSetSolveCallback(rpmts ts,
313 int (*solve) (rpmts ts, rpmds ds, const void * data),
314 const void * solveData);
315
321 rpmps rpmtsProblems(rpmts ts);
322
327 void rpmtsCleanProblems(rpmts ts);
328
333 void rpmtsClean(rpmts ts);
334
339 void rpmtsEmpty(rpmts ts);
340
346 rpmts rpmtsFree(rpmts ts);
347
353 rpmVSFlags rpmtsVSFlags(rpmts ts);
354
361 rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
362
368 const char * rpmtsRootDir(rpmts ts);
369
376 int rpmtsSetRootDir(rpmts ts, const char * rootDir);
377
383 FD_t rpmtsScriptFd(rpmts ts);
384
390 void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
391
397 rpm_tid_t rpmtsGetTid(rpmts ts);
398
405 rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
406
412 rpmdb rpmtsGetRdb(rpmts ts);
413
423 void * rpmtsNotify(rpmts ts, rpmte te,
424 rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
425
431 int rpmtsNElements(rpmts ts);
432
439 rpmte rpmtsElement(rpmts ts, int ix);
440
446 rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
447
453 rpmtransFlags rpmtsFlags(rpmts ts);
454
461 rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
462
468 rpm_color_t rpmtsColor(rpmts ts);
469
475 rpm_color_t rpmtsPrefColor(rpmts ts);
476
483 rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
484
491 rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color);
492
499 rpmop rpmtsOp(rpmts ts, rpmtsOpX opx);
500
506 rpmPlugins rpmtsPlugins(rpmts ts);
507
519 int rpmtsSetNotifyCallback(rpmts ts,
520 rpmCallbackFunction notify,
521 rpmCallbackData notifyData);
522
527 rpmts rpmtsCreate(void);
528
542 int rpmtsAddInstallElement(rpmts ts, Header h,
543 const fnpyKey key, int upgrade,
544 rpmRelocation * relocs);
545
553 int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
554
560 rpmtsi rpmtsiFree(rpmtsi tsi);
561
567 rpmtsi rpmtsiInit(rpmts ts);
568
575 rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types);
576
577 #ifdef __cplusplus
578 }
579 #endif
580
581
582 #endif /* H_RPMTS */
rpmtsSetNotifyCallback
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
Set transaction notify callback function and argument.
RPMTRANS_FLAG_NODOCS
Definition: rpmts.h:35
rpmCallbackType
enum rpmCallbackType_e rpmCallbackType
Bit(s) to identify progress callbacks.
RPMTRANS_FLAG_NOTRIGGERIN
Definition: rpmts.h:43
RPMTS_OP_FINGERPRINT
Definition: rpmts.h:140
rpmtsImportPubkey
rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char *pkt, size_t pktlen)
Import public key packet(s).
rpmdbMatchIterator
struct rpmdbMatchIterator_s * rpmdbMatchIterator
Definition: rpmtypes.h:68
rpmtsOp
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
Retrieve operation timestamp from a transaction set.
rpmtsFilterFlags
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
Get problem ignore bit mask, i.e.
RPMVSF_NOMD5
Definition: rpmts.h:101
rpmps
struct rpmps_s * rpmps
Definition: rpmtypes.h:70
rpmtsSetColor
rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color)
Set color bits of transaction set.
rpmtsi
struct rpmtsi_s * rpmtsi
Definition: rpmtypes.h:69
rpmtsSetFlags
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
Set transaction flags, i.e.
rpmtsGetRdb
rpmdb rpmtsGetRdb(rpmts ts)
Get transaction set database handle.
rpmtsFree
rpmts rpmtsFree(rpmts ts)
Destroy transaction set, closing the database as well.
RPMVSF_NODSAHEADER
Definition: rpmts.h:97
rpmtsPlugins
rpmPlugins rpmtsPlugins(rpmts ts)
Get the plugins associated with a transaction set.
RPMTRANS_FLAG_NOPREUN
Definition: rpmts.h:45
rpmtsLink
rpmts rpmtsLink(rpmts ts)
Reference a transaction set instance.
RPMVSF_NOMD5HEADER
Definition: rpmts.h:96
RPMTRANS_FLAG_NOTRIGGERUN
Definition: rpmts.h:44
rpmtsRebuildDB
int rpmtsRebuildDB(rpmts ts)
Rebuild the database used by the transaction.
rpmtsGetTid
rpm_tid_t rpmtsGetTid(rpmts ts)
Get transaction id, i.e.
RPMTRANS_FLAG_NOMD5
Definition: rpmts.h:50
RPMVSF_NOSHA1HEADER
Definition: rpmts.h:95
RPMTS_OP_DIGEST
Definition: rpmts.h:146
rpmtsEmpty
void rpmtsEmpty(rpmts ts)
Re-create an empty transaction set.
rpmtsSetKeyring
int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring)
Set keyring to use for this transaction set.
RPMTRANS_FLAG_NOSCRIPTS
Definition: rpmts.h:32
rpmtsNotify
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total)
Perform transaction progress notify callback.
rpmts
struct rpmts_s * rpmts
The main types involved in transaction manipulation.
Definition: rpmtypes.h:63
rpmCallbackData
void * rpmCallbackData
Definition: rpmtypes.h:74
RPMTS_OP_ERASE
Definition: rpmts.h:142
rpmtsColor
rpm_color_t rpmtsColor(rpmts ts)
Retrieve color bits of transaction set.
RPMVSF_NORSAHEADER
Definition: rpmts.h:98
rpmtsPrefColor
rpm_color_t rpmtsPrefColor(rpmts ts)
Retrieve preferred file color.
rpmprobFilterFlags
rpmFlags rpmprobFilterFlags
Definition: rpmprob.h:34
rpmtsAddInstallElement
int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
Add package to be installed to transaction set.
RPMTS_OP_ORDER
Definition: rpmts.h:139
RPMVSF_DEFAULT
Definition: rpmts.h:91
rpmRelocation_s
We pass these around as an array with a sentinel.
Definition: rpmfi.h:94
rpmtsSetSolveCallback
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
Set dependency solver callback.
rpmtsScriptFd
FD_t rpmtsScriptFd(rpmts ts)
Get transaction script file handle, i.e.
RPMTRANS_FLAG_NOTRIGGERPREIN
Definition: rpmts.h:40
rpmtsInitIterator
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
Return transaction database iterator.
rpmKeyring
struct rpmKeyring_s * rpmKeyring
Definition: rpmtypes.h:78
RPMVSF_NORSA
Definition: rpmts.h:103
rpmtsCreate
rpmts rpmtsCreate(void)
Create an empty transaction set.
rpmPlugins
struct rpmPlugins_s * rpmPlugins
Definition: rpmtypes.h:83
_rpmts_stats
int _rpmts_stats
RPMTRANS_FLAG_NOTRIGGERPOSTUN
Definition: rpmts.h:47
rpmFlags
uint32_t rpmFlags
Definition: rpmtypes.h:42
RPMTS_OP_DBADD
Definition: rpmts.h:148
rpmtsInitDB
int rpmtsInitDB(rpmts ts, int dbmode)
Initialize the database used by the transaction.
RPMTS_OP_DBPUT
Definition: rpmts.h:151
RPMTRANS_FLAG_NOCOLLECTIONS
Definition: rpmts.h:49
rpmdb
struct rpmdb_s * rpmdb
Definition: rpmtypes.h:67
rpmtransFlags_e
rpmtransFlags_e
Bit(s) to control rpmtsRun() operation.
Definition: rpmts.h:28
rpmtsOpX
enum rpmtsOpX_e rpmtsOpX
Indices for timestamps.
FD_t
struct _FD_s * FD_t
RPM IO file descriptor type.
Definition: rpmtypes.h:95
rpmtsVerifyDB
int rpmtsVerifyDB(rpmts ts)
Verify the database used by the transaction.
rpm_color_t
uint32_t rpm_color_t
Definition: rpmtypes.h:38
rpmtsCloseDB
int rpmtsCloseDB(rpmts ts)
Close the database used by the transaction.
RPMTS_OP_UNCOMPRESS
Definition: rpmts.h:145
RPMTRANS_FLAG_DEPLOOPS
Definition: rpmts.h:54
Header
struct headerToken_s * Header
RPM header and data retrieval types.
Definition: rpmtypes.h:24
rpmVSFlags_e
rpmVSFlags_e
Bit(s) to control digest and signature verification.
Definition: rpmts.h:90
rpmtsRootDir
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
fnpyKey
const void * fnpyKey
Definition: rpmtypes.h:73
RPMTRANS_FLAG_NOCONTEXTS
Definition: rpmts.h:38
rpmCallbackFunction
void *(* rpmCallbackFunction)(const void *h, const rpmCallbackType what, const rpm_loff_t amount, const rpm_loff_t total, fnpyKey key, rpmCallbackData data)
Definition: rpmcallback.h:39
RPMVSF_NOSHA1
Definition: rpmts.h:100
rpmVSFlags
rpmFlags rpmVSFlags
Definition: rpmts.h:107
RPMTS_OP_SIGNATURE
Definition: rpmts.h:147
rpmds
struct rpmds_s * rpmds
Definition: rpmtypes.h:65
rpmtsOpenDB
int rpmtsOpenDB(rpmts ts, int dbmode)
Open the database used by the transaction.
RPMTRANS_FLAG_NOPOST
Definition: rpmts.h:42
rpmtsiFree
rpmtsi rpmtsiFree(rpmtsi tsi)
Destroy transaction element iterator.
rpmtsElement
rpmte rpmtsElement(rpmts ts, int ix)
Return (ordered) transaction set element.
rpmtsiNext
rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types)
Return next transaction element of type.
rpmtsSetDBMode
int rpmtsSetDBMode(rpmts ts, int dbmode)
Set the transaction database mode.
rpmte
struct rpmte_s * rpmte
Definition: rpmtypes.h:64
RPMTRANS_FLAG_ALLFILES
Definition: rpmts.h:36
RPMTS_OP_SCRIPTLETS
Definition: rpmts.h:143
RPMTRANS_FLAG_NOPOSTUN
Definition: rpmts.h:46
rpmop_s
Cumulative statistics for an operation.
Definition: rpmsw.h:40
RPMTRANS_FLAG_BUILD_PROBS
Definition: rpmts.h:31
RPMTRANS_FLAG_NOTRIGGERS
Definition: rpmts.h:34
rpmtsSetVSFlags
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
Set verify signatures flag(s).
rpmtsGetKeyring
rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload)
Retrieve handle for keyring used for this transaction set.
rpm_tid_t
uint32_t rpm_tid_t
Definition: rpmtypes.h:40
rpmtsOrder
int rpmtsOrder(rpmts ts)
Determine package order in a transaction set according to dependencies.
RPMTS_OP_INSTALL
Definition: rpmts.h:141
rpmtsClean
void rpmtsClean(rpmts ts)
Free memory needed only for dependency checks and ordering.
rpmDbiTagVal
rpm_tag_t rpmDbiTagVal
Definition: rpmtypes.h:31
rpmtsAddEraseElement
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
Add package to be erased to transaction set.
rpmtsRun
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
Process all package elements in a transaction set.
RPMTRANS_FLAG_NOPRE
Definition: rpmts.h:41
rpmtsGetDBMode
int rpmtsGetDBMode(rpmts ts)
Return the transaction database mode.
rpmtsNElements
int rpmtsNElements(rpmts ts)
Return number of (ordered) transaction set elements.
RPMTRANS_FLAG_NONE
Definition: rpmts.h:29
rpmtsFlags
rpmtransFlags rpmtsFlags(rpmts ts)
Get transaction flags, i.e.
RPMTS_OP_CHECK
Definition: rpmts.h:138
rpmElementTypes
rpmFlags rpmElementTypes
Definition: rpmte.h:24
rpmtsVSFlags
rpmVSFlags rpmtsVSFlags(rpmts ts)
Get verify signatures flag(s).
RPMTRANS_FLAG_TEST
Definition: rpmts.h:30
RPMTS_OP_DBDEL
Definition: rpmts.h:152
rpmtsSetPrefColor
rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color)
Set preferred file color.
RPMTRANS_FLAG_NOFILEDIGEST
Definition: rpmts.h:51
RPMTRANS_FLAG_NOCONFIGS
Definition: rpmts.h:53
RPMTS_OP_TOTAL
Definition: rpmts.h:137
RPMVSF_NODSA
Definition: rpmts.h:102
RPMTS_OP_COMPRESS
Definition: rpmts.h:144
rpmtransFlags
rpmFlags rpmtransFlags
Definition: rpmts.h:57
rpmtsSetRootDir
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
Set transaction rootDir, i.e.
RPMTS_OP_DBREMOVE
Definition: rpmts.h:149
RPMVSF_NEEDPAYLOAD
Definition: rpmts.h:93
RPMVSF_NOHDRCHK
Definition: rpmts.h:92
rpmtsSetScriptFd
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
Set transaction script file handle, i.e.
RPMTRANS_FLAG_JUSTDB
Definition: rpmts.h:33
rpmtsOpX_e
rpmtsOpX_e
Indices for timestamps.
Definition: rpmts.h:136
RPMTS_OP_DBGET
Definition: rpmts.h:150
rpmtsCheck
int rpmtsCheck(rpmts ts)
Perform dependency resolution on the transaction set.
rpm_loff_t
uint64_t rpm_loff_t
Definition: rpmtypes.h:51
rpmtsCleanProblems
void rpmtsCleanProblems(rpmts ts)
Clean current transaction problem set.
RPMTS_OP_MAX
Definition: rpmts.h:153
rpmtsiInit
rpmtsi rpmtsiInit(rpmts ts)
Create transaction element iterator.
rpmRC
enum rpmRC_e rpmRC
Package read return codes.
rpmtsProblems
rpmps rpmtsProblems(rpmts ts)
Return current transaction set problems.
rpmtsSetTid
rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid)
Set transaction id, i.e.