4 /** \ingroup rpmtrans payload
6 * Package state machine to handle a package from a transaction set.
14 #define PSM_VERBOSE 0x8000
15 #define PSM_INTERNAL 0x4000
16 #define PSM_SYSCALL 0x2000
17 #define PSM_DEAD 0x1000
18 #define _fv(_a) ((_a) | PSM_VERBOSE)
19 #define _fi(_a) ((_a) | PSM_INTERNAL)
20 #define _fs(_a) ((_a) | (PSM_INTERNAL | PSM_SYSCALL))
21 #define _fd(_a) ((_a) | (PSM_INTERNAL | PSM_DEAD))
22 typedef enum pkgStage_e {
45 PSM_IMMED_TRIGGERS = 55,
50 PSM_RPMDB_REMOVE = 99,
62 rpmTransactionSet ts; /*!< transaction set */
64 transactionElement te; /*!< transaction element */
66 TFI_t fi; /*!< transaction element file info */
67 FD_t cfd; /*!< Payload file handle. */
68 FD_t fd; /*!< Repackage file handle. */
69 Header oh; /*!< Repackage/multilib header. */
71 rpmdbMatchIterator mi;
73 const char * stepName;
75 const char * rpmio_flags;
77 const char * failedFile;
79 const char * pkgURL; /*!< Repackage URL. */
81 const char * pkgfn; /*!< Repackage file name. */
82 int scriptTag; /*!< Scriptlet data tag. */
83 int progTag; /*!< Scriptlet interpreter tag. */
84 int npkgs_installed; /*!< No. of installed instances. */
85 int scriptArg; /*!< Scriptlet package arg. */
86 int sense; /*!< One of RPMSENSE_TRIGGER{IN,UN,POSTUN}. */
87 int countCorrection; /*!< 0 if installing, -1 if removing. */
88 int chrootDone; /*!< Was chroot(2) done by pkgStage? */
89 rpmCallbackType what; /*!< Callback type. */
90 unsigned long amount; /*!< Callback amount. */
91 unsigned long total; /*!< Callback total. */
103 * Return formatted string representation of package disposition.
104 * @param a package dispostion
105 * @return formatted string
107 /*@observer@*/ const char *const fiTypeString(/*@partial@*/TFI_t fi)
111 * Package state machine driver.
112 * @param psm package state machine data
113 * @param stage next stage
114 * @return 0 on success
116 int psmStage(PSM_t psm, pkgStage stage)
117 /*@globals rpmGlobalMacroContext,
118 fileSystem, internalState @*/
119 /*@modifies psm, rpmGlobalMacroContext,
120 fileSystem, internalState @*/;