diff options
Diffstat (limited to 'lib/transaction.c')
-rw-r--r-- | lib/transaction.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/transaction.c b/lib/transaction.c index 87287478b..3a7cb740c 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -1473,6 +1473,8 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) tsMembers tsmem = rpmtsMembers(ts); rpmlock lock = NULL; rpmps tsprobs = NULL; + int TsmPreDone = 0; /* TsmPre hook hasn't been called */ + /* Force default 022 umask during transaction for consistent results */ mode_t oldmask = umask(022); @@ -1504,6 +1506,7 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) tsprobs = checkProblems(ts); /* Run pre transaction hook for all plugins */ + TsmPreDone = 1; if (rpmpluginsCallTsmPre(ts->plugins, ts) == RPMRC_FAIL) { goto exit; } @@ -1551,12 +1554,11 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) runTransScripts(ts, PKG_POSTTRANS); } +exit: /* Run post transaction hook for all plugins */ - if (rpmpluginsCallTsmPost(ts->plugins, ts) == RPMRC_FAIL) { - goto exit; - } + if (TsmPreDone) /* If TsmPre hook has been called, call the TsmPost hook */ + rpmpluginsCallTsmPost(ts->plugins, ts, rc); -exit: /* Finish up... */ (void) umask(oldmask); (void) rpmtsFinish(ts); |