[Rpm-maint] Problems with %Requires(preun):

Pixel pixel at mandriva.com
Tue Dec 11 16:53:21 UTC 2007

Scott Bambrough <scottb at xandros.com> writes:

> This package fails to uninstall, as the pre-uninstall script fails,
> because it cannot find a script from dv-xdg-utils.  The problem seems to
> be that dv-xdg-utils has been removed before the post-uninstall script
> in dv-bw-quickstart has been run.
> Typically this is seen when I remove our product from the system in a
> transaction with over 100 rpm's, but I have managed to reproduce this
> behaviour with just:  rpm -e dv-xdg-utils dv-bw-quickstart

afaik rpm does not order package removal :-(

that's one reason for the following patch:
if %post of foo-2 fails,
or if %preun of foo-1 fails,
or if %postun of foo-1 fails,
=> foo-1 is not removed, so we end up with both packages in rpmdb
this patch makes rpm ignore the error in those cases
failing %pre must still make the rpm install fail (#23677)

(nb: the exit code for pretrans/posttrans & trigger/triggerun/triggerpostun
      scripts is ignored with or without this patch)

--- rpm-4.4.6/lib/psm.c.pix	2006-04-03 01:12:33.000000000 +0200
+++ rpm-4.4.6/lib/psm.c	2007-01-19 16:31:49.000000000 +0100
@@ -1050,6 +1050,9 @@
     progArgv = hfd(progArgv, ptt);
     script = hfd(script, stt);
+    if (rc != RPMRC_OK && psm->progTag != RPMTAG_PREINPROG) {
+        return RPMRC_OK;
+    }
     return rc;

More information about the Rpm-maint mailing list