rpm 4.19.92
The RPM Package Manager
Loading...
Searching...
No Matches
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/rpmfi.h>
16#include <rpm/rpmcallback.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
22extern int _rpmts_stats;
23
28 RPMTRANS_FLAG_NONE = 0,
29 RPMTRANS_FLAG_TEST = (1 << 0),
39 RPMTRANS_FLAG_NODB = (1 << 10),
40 /* bits 11-13 unused */
44 RPMTRANS_FLAG_NOPRE = (1 << 17),
54 RPMTRANS_FLAG_NOMD5 = (1 << 27),
56 /* bit 28 unused */
59 RPMTRANS_FLAG_DEPLOOPS = (1 << 31)
60};
61
62typedef rpmFlags rpmtransFlags;
63
64#define _noTransScripts \
65 ( RPMTRANS_FLAG_NOPRE | \
66 RPMTRANS_FLAG_NOPOST | \
67 RPMTRANS_FLAG_NOPREUN | \
68 RPMTRANS_FLAG_NOPOSTUN | \
69 RPMTRANS_FLAG_NOPRETRANS | \
70 RPMTRANS_FLAG_NOPOSTTRANS | \
71 RPMTRANS_FLAG_NOPREUNTRANS |\
72 RPMTRANS_FLAG_NOPOSTUNTRANS \
73 )
74
75#define _noTransTriggers \
76 ( RPMTRANS_FLAG_NOTRIGGERPREIN | \
77 RPMTRANS_FLAG_NOTRIGGERIN | \
78 RPMTRANS_FLAG_NOTRIGGERUN | \
79 RPMTRANS_FLAG_NOTRIGGERPOSTUN \
80 )
81
82/* Avoid unnecessary breakage for stuff referring to these unused flags */
83#define RPMTRANS_FLAG_NOPAYLOAD 0
84#define RPMTRANS_FLAG_APPLYONLY 0
85#define RPMTRANS_FLAG_KEEPOBSOLETE 0
86#define RPMTRANS_FLAG_DIRSTASH 0
87#define RPMTRANS_FLAG_REPACKAGE 0
88#define RPMTRANS_FLAG_PKGCOMMIT 0
89#define RPMTRANS_FLAG_PKGUNDO 0
90#define RPMTRANS_FLAG_COMMIT 0
91#define RPMTRANS_FLAG_UNDO 0
92#define RPMTRANS_FLAG_REVERSE 0
93#define RPMTRANS_FLAG_NOSUGGEST 0
94#define RPMTRANS_FLAG_ADDINDEPS 0
95
100 RPMVSF_DEFAULT = 0,
101 RPMVSF_NOHDRCHK = (1 << 0),
102 RPMVSF_NEEDPAYLOAD = (1 << 1),
103 /* bit(s) 2-7 unused */
104 RPMVSF_NOSHA1HEADER = (1 << 8),
105 RPMVSF_NOSHA256HEADER = (1 << 9),
106 RPMVSF_NODSAHEADER = (1 << 10),
107 RPMVSF_NORSAHEADER = (1 << 11),
108 /* bit(s) 12-15 unused */
109 RPMVSF_NOPAYLOAD = (1 << 16),
110 RPMVSF_NOMD5 = (1 << 17),
111 RPMVSF_NODSA = (1 << 18),
112 RPMVSF_NORSA = (1 << 19)
113 /* bit(s) 16-31 unused */
114};
115
116typedef rpmFlags rpmVSFlags;
117
118#define RPMVSF_MASK_NODIGESTS \
119 ( RPMVSF_NOSHA1HEADER | \
120 RPMVSF_NOSHA256HEADER | \
121 RPMVSF_NOPAYLOAD | \
122 RPMVSF_NOMD5 )
123#define _RPMVSF_NODIGESTS RPMVSF_MASK_NODIGESTS
124
125#define RPMVSF_MASK_NOSIGNATURES \
126 ( RPMVSF_NODSAHEADER | \
127 RPMVSF_NORSAHEADER | \
128 RPMVSF_NODSA | \
129 RPMVSF_NORSA )
130#define _RPMVSF_NOSIGNATURES RPMVSF_MASK_NOSIGNATURES
131
132#define RPMVSF_MASK_NOHEADER \
133 ( RPMVSF_NOSHA1HEADER | \
134 RPMVSF_NOSHA256HEADER | \
135 RPMVSF_NODSAHEADER | \
136 RPMVSF_NORSAHEADER )
137#define _RPMVSF_NOHEADER RPMVSF_MASK_NOHEADER
138
139#define RPMVSF_MASK_NOPAYLOAD \
140 ( RPMVSF_NOMD5 | \
141 RPMVSF_NOPAYLOAD | \
142 RPMVSF_NODSA | \
143 RPMVSF_NORSA )
144#define _RPMVSF_NOPAYLOAD RPMVSF_MASK_NOPAYLOAD
145
146enum {
147 RPMSIG_NONE_TYPE = 0,
148 RPMSIG_DIGEST_TYPE = (1 << 0),
149 RPMSIG_SIGNATURE_TYPE = (1 << 1),
150 RPMSIG_OTHER_TYPE = (1 << 2),
151};
152
153#define RPMSIG_VERIFIABLE_TYPE (RPMSIG_DIGEST_TYPE|RPMSIG_SIGNATURE_TYPE)
154#define RPMSIG_UNVERIFIED_TYPE (1 << 30)
155
159typedef enum rpmtsOpX_e {
160 RPMTS_OP_TOTAL = 0,
161 RPMTS_OP_CHECK = 1,
162 RPMTS_OP_ORDER = 2,
163 RPMTS_OP_FINGERPRINT = 3,
164 RPMTS_OP_INSTALL = 5,
165 RPMTS_OP_ERASE = 6,
166 RPMTS_OP_SCRIPTLETS = 7,
167 RPMTS_OP_COMPRESS = 8,
168 RPMTS_OP_UNCOMPRESS = 9,
169 RPMTS_OP_DIGEST = 10,
170 RPMTS_OP_SIGNATURE = 11,
171 RPMTS_OP_DBADD = 12,
172 RPMTS_OP_DBREMOVE = 13,
173 RPMTS_OP_DBGET = 14,
174 RPMTS_OP_DBPUT = 15,
175 RPMTS_OP_DBDEL = 16,
176 RPMTS_OP_VERIFY = 17,
177 RPMTS_OP_MAX = 18
179
180enum rpmtxnFlags_e {
181 RPMTXN_READ = (1 << 0),
182 RPMTXN_WRITE = (1 << 1),
183};
184typedef rpmFlags rpmtxnFlags;
185
186typedef enum rpmtsEvent_e {
187 RPMTS_EVENT_ADD = 1,
188 RPMTS_EVENT_DEL = 2,
189} rpmtsEvent;
190
204 (int event, rpmte te, rpmte other, void *data);
205
217
235
253int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet);
254
261
268
275int rpmtsOpenDB(rpmts ts, int dbmode);
276
283int rpmtsInitDB(rpmts ts, int perms);
284
291
299int rpmtsSetDBMode(rpmts ts, int dbmode);
300
307
314
323rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag,
324 const void * keyp, size_t keylen);
325
333rpmRC rpmtsImportHeader(rpmtxn txn, Header h, rpmFlags flags);
334
343rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char * pkt, size_t pktlen);
344
351rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload);
352
361int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring);
362
371 int (*solve) (rpmts ts, rpmds ds, const void * data),
372 const void * solveData);
373
380
386
392
398
405
411rpmVSFlags rpmtsVSFlags(rpmts ts);
412
419rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags);
420
426rpmVSFlags rpmtsVfyFlags(rpmts ts);
427
434rpmVSFlags rpmtsSetVfyFlags(rpmts ts, rpmVSFlags vfyflags);
435
442
449int rpmtsSetVfyLevel(rpmts ts, int vfylevel);
450
456const char * rpmtsRootDir(rpmts ts);
457
469int rpmtsSetRootDir(rpmts ts, const char * rootDir);
470
477
483void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
484
490rpm_tid_t rpmtsGetTid(rpmts ts);
491
498rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid);
499
506
516void * rpmtsNotify(rpmts ts, rpmte te,
517 rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total);
518
525
532rpmte rpmtsElement(rpmts ts, int ix);
533
539rpmprobFilterFlags rpmtsFilterFlags(rpmts ts);
540
546rpmtransFlags rpmtsFlags(rpmts ts);
547
554rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags);
555
561rpm_color_t rpmtsColor(rpmts ts);
562
568rpm_color_t rpmtsPrefColor(rpmts ts);
569
576rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color);
577
584rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color);
585
593
599rpmPlugins rpmtsPlugins(rpmts ts);
600
613 rpmCallbackFunction notify,
614 rpmCallbackData notifyData);
615
624int rpmtsSetNotifyStyle(rpmts ts, int style);
625
633
646
652
667 const fnpyKey key, int upgrade,
668 rpmRelocation * relocs);
669
678int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key);
679
687
695int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset);
696
703rpmtxn rpmtxnBegin(rpmts ts, rpmtxnFlags flags);
704
710rpmtxn rpmtxnEnd(rpmtxn txn);
711
717rpmtsi rpmtsiFree(rpmtsi tsi);
718
724rpmtsi rpmtsiInit(rpmts ts);
725
732rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types);
733
734#ifdef __cplusplus
735}
736#endif
737
738
739#endif /* H_RPMTS */
rpmte rpmtsiNext(rpmtsi tsi, rpmElementTypes types)
rpmtsi rpmtsiInit(rpmts ts)
rpmtsi rpmtsiFree(rpmtsi tsi)
int rpmtsGetNotifyStyle(rpmts ts)
rpmtxn rpmtxnBegin(rpmts ts, rpmtxnFlags flags)
rpmVSFlags_e
Definition rpmts.h:99
int rpmtsSetNotifyCallback(rpmts ts, rpmCallbackFunction notify, rpmCallbackData notifyData)
rpm_color_t rpmtsSetPrefColor(rpmts ts, rpm_color_t color)
rpm_color_t rpmtsSetColor(rpmts ts, rpm_color_t color)
int rpmtsAddInstallElement(rpmts ts, Header h, const fnpyKey key, int upgrade, rpmRelocation *relocs)
rpmtransFlags rpmtsFlags(rpmts ts)
int rpmtsAddReinstallElement(rpmts ts, Header h, const fnpyKey key)
rpmps rpmtsProblems(rpmts ts)
rpmte rpmtsElement(rpmts ts, int ix)
int rpmtsSetRootDir(rpmts ts, const char *rootDir)
int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
int rpmtsRebuildDB(rpmts ts)
rpmKeyring rpmtsGetKeyring(rpmts ts, int autoload)
void * rpmtsNotify(rpmts ts, rpmte te, rpmCallbackType what, rpm_loff_t amount, rpm_loff_t total)
rpmVSFlags rpmtsSetVfyFlags(rpmts ts, rpmVSFlags vfyflags)
rpmVSFlags rpmtsVSFlags(rpmts ts)
int rpmtsGetDBMode(rpmts ts)
rpmts rpmtsFree(rpmts ts)
int rpmtsSetKeyring(rpmts ts, rpmKeyring keyring)
rpmVSFlags rpmtsSetVSFlags(rpmts ts, rpmVSFlags vsflags)
rpm_tid_t rpmtsGetTid(rpmts ts)
rpmRC rpmtsImportHeader(rpmtxn txn, Header h, rpmFlags flags)
rpmVSFlags rpmtsVfyFlags(rpmts ts)
rpmts rpmtsLink(rpmts ts)
rpmtransFlags rpmtsSetFlags(rpmts ts, rpmtransFlags transFlags)
rpm_tid_t rpmtsSetTid(rpmts ts, rpm_tid_t tid)
void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd)
int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset)
void rpmtsEmpty(rpmts ts)
int rpmtsSetChangeCallback(rpmts ts, rpmtsChangeFunction notify, void *data)
int(* rpmtsChangeFunction)(int event, rpmte te, rpmte other, void *data)
Definition rpmts.h:204
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:61
int rpmtsOpenDB(rpmts ts, int dbmode)
rpmtsOpX_e
Definition rpmts.h:159
int rpmtsSetSolveCallback(rpmts ts, int(*solve)(rpmts ts, rpmds ds, const void *data), const void *solveData)
rpmRC rpmtsImportPubkey(rpmts ts, const unsigned char *pkt, size_t pktlen)
void rpmtsCleanProblems(rpmts ts)
const char * rpmtsRootDir(rpmts ts)
int rpmtsVerifyDB(rpmts ts)
rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmDbiTagVal rpmtag, const void *keyp, size_t keylen)
int rpmtsVfyLevel(rpmts ts)
rpm_color_t rpmtsPrefColor(rpmts ts)
rpmprobFilterFlags rpmtsFilterFlags(rpmts ts)
int rpmtsOrder(rpmts ts)
rpmop rpmtsOp(rpmts ts, rpmtsOpX opx)
int rpmtsSetVfyLevel(rpmts ts, int vfylevel)
rpmtxn rpmtxnEnd(rpmtxn txn)
rpmtransFlags_e
Definition rpmts.h:27
rpmts rpmtsCreate(void)
int rpmtsSetDBMode(rpmts ts, int dbmode)
rpm_color_t rpmtsColor(rpmts ts)
int rpmtsAddRestoreElement(rpmts ts, Header h)
void rpmtsClean(rpmts ts)
int rpmtsSetNotifyStyle(rpmts ts, int style)
int rpmtsNElements(rpmts ts)
int rpmtsCloseDB(rpmts ts)
rpmdb rpmtsGetRdb(rpmts ts)
int rpmtsCheck(rpmts ts)
rpmPlugins rpmtsPlugins(rpmts ts)
enum rpmtsOpX_e rpmtsOpX
FD_t rpmtsScriptFd(rpmts ts)
int rpmtsInitDB(rpmts ts, int perms)
@ RPMTRANS_FLAG_NOCONFIGS
Definition rpmts.h:58
@ RPMTRANS_FLAG_NOMD5
Definition rpmts.h:54
@ RPMTRANS_FLAG_NOCAPS
Definition rpmts.h:38
@ RPMTRANS_FLAG_NOPREUN
Definition rpmts.h:48
@ RPMTRANS_FLAG_NOPLUGINS
Definition rpmts.h:36
@ RPMTRANS_FLAG_NOFILEDIGEST
Definition rpmts.h:55
@ RPMTRANS_FLAG_NOARTIFACTS
Definition rpmts.h:57
@ RPMTRANS_FLAG_NOTRIGGERIN
Definition rpmts.h:46
@ RPMTRANS_FLAG_NOTRIGGERPREIN
Definition rpmts.h:43
@ RPMTRANS_FLAG_NOPOSTUNTRANS
Definition rpmts.h:42
@ RPMTRANS_FLAG_NOPRETRANS
Definition rpmts.h:51
@ RPMTRANS_FLAG_NOSCRIPTS
Definition rpmts.h:31
@ RPMTRANS_FLAG_NOPOSTUN
Definition rpmts.h:49
@ RPMTRANS_FLAG_NOPRE
Definition rpmts.h:44
@ RPMTRANS_FLAG_NOPREUNTRANS
Definition rpmts.h:41
@ RPMTRANS_FLAG_JUSTDB
Definition rpmts.h:32
@ RPMTRANS_FLAG_NOTRIGGERPOSTUN
Definition rpmts.h:50
@ RPMTRANS_FLAG_NOTRIGGERUN
Definition rpmts.h:47
@ RPMTRANS_FLAG_NOPOST
Definition rpmts.h:45
@ RPMTRANS_FLAG_NODOCS
Definition rpmts.h:34
@ RPMTRANS_FLAG_NOCONTEXTS
Definition rpmts.h:37
@ RPMTRANS_FLAG_NOTRIGGERS
Definition rpmts.h:33
@ RPMTRANS_FLAG_NODB
Definition rpmts.h:39
@ RPMTRANS_FLAG_ALLFILES
Definition rpmts.h:35
@ RPMTRANS_FLAG_TEST
Definition rpmts.h:29
@ RPMTRANS_FLAG_DEPLOOPS
Definition rpmts.h:59
@ RPMTRANS_FLAG_NOPOSTTRANS
Definition rpmts.h:52
@ RPMTRANS_FLAG_NOSYSUSERS
Definition rpmts.h:53
@ RPMTRANS_FLAG_BUILD_PROBS
Definition rpmts.h:30
struct _FD_s * FD_t
Definition rpmtypes.h:99
struct rpmts_s * rpmts
Definition rpmtypes.h:63
enum rpmRC_e rpmRC
struct headerToken_s * Header
Definition rpmtypes.h:24
enum rpmCallbackType_e rpmCallbackType
Definition rpmfiles.h:129
Definition rpmsw.h:42