21 struct sharedFileInfo {
30 struct transactionFileInfo_s {
31 /* for all packages */
32 enum rpmTransactionType type;
33 fileAction action; /*!< File disposition default. */
34 /*@owned@*/ fileAction * actions; /*!< File disposition(s) */
35 /*@owned@*/ struct fingerPrint_s * fps; /*!< File fingerprint(s) */
36 HGE_t hge; /*!< Vector to headerGetEntry() */
37 HFD_t hfd; /*!< Vector to headerFreeData() */
38 Header h; /*!< Package header */
39 /*@owned@*/ const char * name;
40 /*@owned@*/ const char * version;
41 /*@owned@*/ const char * release;
43 uint_32 flags; /*!< File flag default. */
44 const uint_32 * fflags; /*!< File flag(s) (from header) */
45 const uint_32 * fsizes; /*!< File size(s) (from header) */
46 const uint_32 * fmtimes; /*!< File modification time(s) (from header) */
47 /*@owned@*/ const char ** bnl; /*!< Base name(s) (from header) */
48 /*@owned@*/ const char ** dnl; /*!< Directory name(s) (from header) */
49 int_32 * dil; /*!< Directory indice(s) (from header) */
50 /*@owned@*/ const char ** obnl; /*!< Original base name(s) (from header) */
51 /*@owned@*/ const char ** odnl; /*!< Original directory name(s) (from header) */
52 int_32 * odil; /*!< Original directory indice(s) (from header) */
53 /*@owned@*/ const char ** fmd5s;/*!< File MD5 sum(s) (from header) */
54 /*@owned@*/ const char ** flinks; /*!< File link(s) (from header) */
55 /* XXX setuid/setgid bits are turned off if fuser/fgroup doesn't map. */
56 uint_16 * fmodes; /*!< File mode(s) (from header) */
57 /*@owned@*/ char * fstates; /*!< File state(s) (from header) */
58 /*@owned@*/ const char ** fuser; /*!< File owner(s) */
59 /*@owned@*/ const char ** fgroup; /*!< File group(s) */
60 /*@owned@*/ const char ** flangs; /*!< File lang(s) */
61 int fc; /*!< No. of files. */
62 int dc; /*!< No. of directories. */
63 int bnlmax; /*!< Length (in bytes) of longest base name. */
64 int dnlmax; /*!< Length (in bytes) of longest dir name. */
67 unsigned int archiveSize;
68 mode_t dperms; /*!< Directory perms (0755) if not mapped. */
69 mode_t fperms; /*!< File perms (0644) if not mapped. */
70 /*@owned@*/ const char ** apath;
72 /*@owned@*/ int * fmapflags;
74 /*@owned@*/ /*@null@*/ uid_t * fuids; /*!< File uid(s) */
76 /*@owned@*/ /*@null@*/ gid_t * fgids; /*!< File gid(s) */
78 #define TFIMAGIC 0x09697923
79 /*@owned@*/ FSM_t fsm; /*!< File state machine data. */
81 /* these are for TR_ADDED packages */
82 /*@dependent@*/ struct availablePackage * ap;
83 /*@owned@*/ struct sharedFileInfo * replaced;
84 /*@owned@*/ uint_32 * replacedSizes;
85 /* for TR_REMOVED packages */
91 #define PSM_VERBOSE 0x8000
92 #define PSM_INTERNAL 0x4000
93 #define PSM_SYSCALL 0x2000
94 #define PSM_DEAD 0x1000
95 #define _fv(_a) ((_a) | PSM_VERBOSE)
96 #define _fi(_a) ((_a) | PSM_INTERNAL)
97 #define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
98 #define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
99 typedef enum pkgStage_e {
122 PSM_IMMED_TRIGGERS = 55,
123 PSM_RPMIO_FLAGS = 56,
127 PSM_RPMDB_REMOVE = 99,
138 /*@kept@*/ rpmTransactionSet ts;/*!< transaction set */
139 /*@kept@*/ TFI_t fi; /*!< transaction element file info */
140 FD_t cfd; /*!< Payload file handle. */
141 FD_t fd; /*!< Repackage file handle. */
142 Header oh; /*!< Repackage/multilib header. */
143 rpmdbMatchIterator mi;
144 /*@observer@*/ const char * stepName;
145 /*@owned@*/ const char * rpmio_flags;
146 /*@owned@*/ const char * failedFile;
147 /*@owned@*/ const char * pkgURL; /*!< Repackage URL. */
148 /*@dependent@*/ const char * pkgfn; /*!< Repackage file name. */
149 int scriptTag; /*!< Scriptlet data tag. */
150 int progTag; /*!< Scriptlet interpreter tag. */
151 int npkgs_installed; /*!< No. of installed instances. */
152 int scriptArg; /*!< Scriptlet package arg. */
153 int sense; /*!< One of RPMSENSE_TRIGGER{IN,UN,POSTUN}. */
154 int countCorrection; /*!< 0 if installing, -1 if removing. */
155 int chrootDone; /*!< Was chroot(2) done by pkgStage? */
156 rpmCallbackType what; /*!< Callback type. */
157 unsigned long amount; /*!< Callback amount. */
158 unsigned long total; /*!< Callback total. */
169 * Load data from header into transaction file element info.
171 * @param fi transaction element file info
173 void loadFi(Header h, TFI_t fi)
174 /*@modifies h, fi @*/;
177 * Destroy transaction element file info.
178 * @param fi transaction element file info
180 void freeFi(TFI_t fi)
184 * Return formatted string representation of package disposition.
185 * @param a package dispostion
186 * @return formatted string
188 /*@observer@*/ const char *const fiTypeString(TFI_t fi);
191 * Package state machine driver.
192 * @param psm package state machine data
193 * @param stage next stage
194 * @return 0 on success
196 int psmStage(PSM_t psm, pkgStage stage)
203 #endif /* H_ROLLBACK */