summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2017-12-15 12:37:08 +0200
committerPanu Matilainen <pmatilai@redhat.com>2018-03-28 14:09:16 +0300
commitf5a58300e1f9267f95f4ecdc2cad0430faf90903 (patch)
treed3d0d14af77d76ef61615b594fc5a0db3b0b9803
parent9afe781d960d354a9576d4d58b1a36a0f39405bc (diff)
downloadrpm-f5a58300e1f9267f95f4ecdc2cad0430faf90903.tar.gz
Move %transfiletriggerun after problem checking and fingerprinting
There's no reason for this to be as evil as %pretrans, it's used for entirely different purposes such as unregistering a whole bunch of modules at once on the uninstall-transaction, and we don't want that to happen if there were file conflicts present. Additionally, file triggers should not fire on skipped / non-installed files. This is currently not taken into account and not changed here, but fingerprinting results are a pre-requisite for doing that. (cherry picked from commit d83edaa2188ecd13fabbf1d779763dcc17bf1b93)
-rw-r--r--lib/transaction.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/transaction.c b/lib/transaction.c
index a2af2b57d..b64f466ab 100644
--- a/lib/transaction.c
+++ b/lib/transaction.c
@@ -1500,15 +1500,6 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
goto exit;
}
- /* Run %transfiletriggerun scripts unless disabled */
- if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_NOPRETRANS|
- RPMTRANS_FLAG_NOTRIGGERUN) || rpmpsNumProblems(tsprobs))) {
-
- runFileTriggers(ts, NULL, RPMSENSE_TRIGGERUN,
- RPMSCRIPT_TRANSFILETRIGGER, 0);
- runTransScripts(ts, PKG_TRANSFILETRIGGERUN);
- }
-
/* Run %pretrans scripts, but only if there are no known problems up to
* this point and not disabled otherwise. This is evil as it runs before
* fingerprinting and problem checking and is best avoided.
@@ -1545,6 +1536,14 @@ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet)
if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_TEST|RPMTRANS_FLAG_BUILD_PROBS)))
tsmem->pool = rpmstrPoolFree(tsmem->pool);
+ /* Run %transfiletriggerun scripts unless disabled */
+ if (!(rpmtsFlags(ts) & (RPMTRANS_FLAG_BUILD_PROBS|RPMTRANS_FLAG_NOPRETRANS|
+ RPMTRANS_FLAG_NOTRIGGERUN))) {
+
+ runFileTriggers(ts, NULL, RPMSENSE_TRIGGERUN,
+ RPMSCRIPT_TRANSFILETRIGGER, 0);
+ runTransScripts(ts, PKG_TRANSFILETRIGGERUN);
+ }
/* Actually install and remove packages, get final exit code */
rc = rpmtsProcess(ts) ? -1 : 0;