Ticket #16 (new defect)

Opened 5 years ago

Last modified 4 years ago

%preun is called with arg 0 during upgrade

Reported by: robbertdam Assigned to: pmatilai
Priority: major Milestone:
Component: rpm Version: RPM Development
Keywords: Cc:


I'm experiencing the following issue when performing an upgrade of my software using RPM.

When upgrading an obsolete package using rpm -U (I used the keyword "obsoletes" in the RPM spec) the following happens:

1. %pre is called on the new package 2. %post is called on the new package 3. %preun is called on the old (obsolete) package with $1 == 0 <--- NOT CORRECT 4. %postun is called on the old package

The issue occurs on the following configuration:

/proc/version Linux version (geeko@buildhost) (gcc version 4.1.2 20061115 (prerelease) (SUSE Linux)) #39 SMP PREEMPT Tu e Sep 23 09:15:55 CEST 2008

Distribution: OpenSuse? 11

On the following configuration, the %preun is not called at all, and the obsolete pacakage appears to be still installed after the upgrade.

Linux version (wijnand@wst102) (gcc version 4.1.2 20061115 (prerelease) (SUSE Lin ux)) #3 SMP PREEMPT Wed Jul 2 16:42:03 CEST 2008

Distribution: OpenSuse? 10.1

In both configurations rpm --version gives "RPM version 4.4.2"

Change History

06/05/09 10:07:46 changed by pmatilai

%preun with $1 == 0 being wrong or not is largely a matter of interpretation: the old package gets erased, not upgraded. But sure, packages dont currently have proper means to know whether they got obsoleted or erased, this is one of the things listed in Problems/Upgrade too.