[Rpm-maint] [rpm-software-management/rpm] Add support for %preuntrans and %postuntrans scriptlets (PR #2177)
Panu Matilainen
notifications at github.com
Wed Sep 21 06:04:48 UTC 2022
@pmatilai commented on this pull request.
> @@ -469,6 +469,17 @@ static rpmpsm rpmpsmNew(rpmts ts, rpmte te, pkgGoal goal)
psm->scriptArg = npkgs_installed + 1;
psm->countCorrection = 0;
break;
+ case PKG_PREUNTRANS:
+ if (rpmteDependsOn(psm->te))
+ psm->scriptArg = npkgs_installed;
+ else
+ psm->scriptArg = npkgs_installed - 1;
+ psm->countCorrection = -1;
+ break;
+ case PKG_POSTUNTRANS:
+ psm->scriptArg = npkgs_installed;
The npkgs_installed is calculated at the time the script runs, so this all depends on where exactly in the transaction stuff happens. When this is calculated for the other scriptlets, the package hasn't yet been removed, but in postuntrans it has.
The related countCorrection in both these is actually unused because that only matters for triggers. I should make a comment on that, it's quite confusing.
--
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/2177#discussion_r976067336
You are receiving this because you are subscribed to this thread.
Message ID: <rpm-software-management/rpm/pull/2177/review/1114801445 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20220920/11f45da9/attachment.html>
More information about the Rpm-maint
mailing list