From: ewt Date: Sun, 5 Apr 1998 17:22:28 +0000 (+0000) Subject: implemented %triggerpostun X-Git-Tag: rpm-4.4-release~3687 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37e6bc17694031a1f7ff14db066921b65f35d4a3;p=platform%2Fupstream%2Frpm.git implemented %triggerpostun CVS patchset: 2071 CVS date: 1998/04/05 17:22:28 --- diff --git a/CHANGES b/CHANGES index 22aaf5f..0512956 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,7 @@ - --nomd5 wasn't handled properly - updated configure.in find-req and find-prov checks (Tim Mooney) - make --rmsource actually work + - run postun triggers 2.4.105 -> 2.4.106: - build: only check for non-printables in first 128 chars diff --git a/docs/triggers b/docs/triggers index b7d5427..c148f1b 100644 --- a/docs/triggers +++ b/docs/triggers @@ -111,3 +111,14 @@ conditions becomes true (the , can be read as "or"). For example: Will put a trigger in package 'package' which runs when the installation status of either fileutils > 3.0 or perl < 1.2 is changed. The script will be run through /usr/bin/perl rather then /bin/sh (which is the default). + +An Unusual Case +--------------- + +There is one other type of trigger available -- %triggerpostun. These are +triggers that are run after their target package has been removed; they will +never be run when the package containing the trigger is removed. + +While this type of trigger is almost never usefull, they allow a package to +fix errors introduced by the %postun of another package (or by an earlier +version of that package). diff --git a/lib/uninstall.c b/lib/uninstall.c index e56bcc6..d6dc1bc 100644 --- a/lib/uninstall.c +++ b/lib/uninstall.c @@ -340,6 +340,11 @@ int rpmRemovePackage(char * prefix, rpmdb db, unsigned int offset, int flags) { flags & RPMUNINSTALL_NOSCRIPTS, 0); } + /* Run postun triggers which are set off by this package's removal */ + if (runTriggers(rootdir, db, RPMSENSE_TRIGGERPOSTUN, h, 0)) { + return 2; + } + headerFree(h); rpmMessage(RPMMESS_DEBUG, "removing database entry\n");