summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fsm.c3
-rw-r--r--lib/fsm.h5
-rw-r--r--lib/psm.c7
3 files changed, 11 insertions, 4 deletions
diff --git a/lib/fsm.c b/lib/fsm.c
index 76f607ed3..8ef4b7044 100644
--- a/lib/fsm.c
+++ b/lib/fsm.c
@@ -613,7 +613,7 @@ static int fsmCreate(FSM_t fsm)
}
int fsmSetup(FSM_t fsm, fileStage goal,
- rpmts ts, rpmte te, rpmfi fi, FD_t cfd,
+ rpmts ts, rpmte te, rpmfi fi, FD_t cfd, rpmpsm psm,
rpm_loff_t * archiveSize, char ** failedFile)
{
int rc, ec = 0;
@@ -625,6 +625,7 @@ int fsmSetup(FSM_t fsm, fileStage goal,
fsm->cpioPos = 0;
fsm->iter = mapInitIterator(ts, te, fi);
fsm->digestalgo = rpmfiDigestAlgo(fi);
+ fsm->psm = psm;
if (fsm->goal == FSM_PKGINSTALL) {
fsm->archivePos = 0;
diff --git a/lib/fsm.h b/lib/fsm.h
index 22aa935a4..5d33fce0b 100644
--- a/lib/fsm.h
+++ b/lib/fsm.h
@@ -104,6 +104,7 @@ typedef rpmFlags cpioMapFlags;
typedef struct fsmIterator_s * FSMI_t;
typedef struct fsm_s * FSM_t;
+typedef struct rpmpsm_s * rpmpsm;
typedef struct hardLink_s * hardLink_t;
@@ -163,6 +164,8 @@ struct fsm_s {
fileStage nstage; /*!< Next file stage. */
struct stat sb; /*!< Current file stat(2) info. */
struct stat osb; /*!< Original file stat(2) info. */
+
+ rpmpsm psm; /*!< "parent" package state machine */
};
#ifdef __cplusplus
@@ -192,6 +195,7 @@ FSM_t freeFSM(FSM_t fsm);
* @param ts transaction set
* @param fi transaction element file info
* @param cfd
+ * @param psm owner psm (or NULL)
* @retval archiveSize pointer to archive size
* @retval failedFile pointer to first file name that failed (malloced)
* @return 0 on success
@@ -201,6 +205,7 @@ int fsmSetup(FSM_t fsm, fileStage goal,
rpmte te,
rpmfi fi,
FD_t cfd,
+ rpmpsm psm,
rpm_loff_t * archiveSize,
char ** failedFile);
diff --git a/lib/psm.c b/lib/psm.c
index c23816a66..36bdebd59 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -49,7 +49,7 @@ typedef enum pkgStage_e {
} pkgStage;
-typedef struct rpmpsm_s {
+struct rpmpsm_s {
rpmts ts; /*!< transaction set */
rpmte te; /*!< current transaction element */
rpmfi fi; /*!< transaction element file info */
@@ -68,7 +68,7 @@ typedef struct rpmpsm_s {
pkgStage nstage; /*!< Next psm stage. */
int nrefs; /*!< Reference count. */
-} * rpmpsm;
+};
static rpmpsm rpmpsmNew(rpmts ts, rpmte te);
static rpmpsm rpmpsmFree(rpmpsm psm);
@@ -661,7 +661,8 @@ static int runFsm(rpmpsm psm, FD_t payload)
sc = fsmSetup(rpmfiFSM(psm->fi),
(psm->goal == PKG_INSTALL) ? FSM_PKGINSTALL : FSM_PKGERASE,
- psm->ts, psm->te, psm->fi, payload, NULL, &psm->failedFile);
+ psm->ts, psm->te, psm->fi, payload, psm,
+ NULL, &psm->failedFile);
if (psm->goal == PKG_INSTALL) {
rpmswAdd(rpmtsOp(psm->ts, RPMTS_OP_UNCOMPRESS),
fdOp(payload, FDSTAT_READ));