+++ This bug was initially created as a clone of Bug #155700 +++ The code path for python erase differs from rpm -e: java-1.4.2-gcj-compat got removed before ant and eclipse-gcj in the transaction, causing breakage: [...] Removing : java-1.4.2-gcj-compat ####################### [ 5/12] [...] Removing : ant ####################### [11/12] /home/scop/rpmbuild/tmp/rpm-tmp.15391: line 1: rebuild-gcj-db: command not found error: %postun(ant-1.6.2-3jpp_6fc.i386) scriptlet failed, exit status 127 Removing : eclipse-ecj ####################### [12/12] /home/scop/rpmbuild/tmp/rpm-tmp.15391: line 1: /usr/bin/rebuild-gcj-db: No such file or directory error: %postun(eclipse-ecj-3.1.0_fc-0.M6.20.i386) scriptlet failed, exit status 127 At least ant, eclipse* and mx4j in FC devel use the "Requires(foo,bar)" syntax to ensure rebuild-gcj-db is available at scriptlet time. Maybe the earlier workaround of splitting that into two: "Requires(foo): ..." and "Requires(bar): ..." should be applied in them (and other affected packages) until it's really fixed in rpm. Checking header: Requires(post,postun): java-1.4.2-gcj-compat >= 1.4.2.0-40jpp_16rh rpm --qf '[%{REQUIRENAME} %{REQUIREFLAGS}\n]' -qp mx4j-2.1.0-1jpp_7fc.i386.rpm | grep comp java-1.4.2-gcj-compat 5196 >>> x = rpm.RPMSENSE_SCRIPT_POSTUN >>> x |= rpm.RPMSENSE_SCRIPT_POST >>> x |= rpm.RPMSENSE_GREATER >>> x |= rpm.RPMSENSE_EQUAL >>> x 5196 Test erase ordering: Install D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth) D: 0 0 1 0 1 0 +required-1.2-1.noarch D: ========== successors only (1938 bytes) D: 1 1 0 0 2 0 +requirer-2.0-1.noarch Erase: D: ========== recording tsort relations D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth) D: 0 0 0 1 1 0 -required-1.2-1.noarch D: ========== successors only (0 bytes) D: 1 0 0 0 1 1 -requirer-2.0-1.noarch D: mounted filesystems: rpm sorts that fine for me with a single dep. Running Transaction Removing : required ######################### [1/2] Removing : requirer ######################### [2/2] /var/tmp/rpm-tmp.39887: line 1: /usr/opt/required/required: No such file or directory error: %postun(requirer-2.0-1.noarch) scriptlet failed, exit status 1 Removed: required.noarch 0:1.2-1 requirer.noarch 0:2.0-1
Looking at rpminstall.c vs. yums code - the difference is we would need (atm) ts.setFlags(rpm.RPMTRANS_FLAG_REVERSE) for erase only transactions I'll also look into whether we can make the sorting algorithm do this automagically.
FYI, this happens also with apt, so automagic in rpmlib would be cool.
Workaround for FC4 in yum, will address properly in rpmlib for fc5 yum-2.3.2-6
2.3.2-6 looks much _worse_ than before. I'm testing with successive "yum -y install ant" and "yum -y remove libgcj" runs (and because the latter fails to properly remove ant due to breakage, "rpm -e --noscripts ant" in between before the next "yum install").
Created attachment 114826 [details] Results of "yum remove libgcj" Here are the results of my "yum remove libgcj". Note for example that the whole dependency chain here depends on libgcj, but it is being removed much too early.
Ville can you edit /usr/lib/python2.4/site-packages/rpmUtils/__init__.py at the top just after the imports put rpm.setVerbosity(rpm.RPMLOG_DEBUG) and rerun the test, attaching output here.
For reference my test specs requirer and required are at http://people.redhat.com/pnasrat/
Will do. I was already checking in what order should my test transaction proceed, so I'll post that first. This is the correct erase sequence for it: 1) ant 2) java-1.4.2-gcj-compat-devel 3) eclipse-ecj 4) jessie and java-1.4.2-gcj-compat (dependency loop) 5) gjdoc or gnu-crypto (both, but order does not matter) 6) gnu-crypto-jce-jdk1.4 or gnu-crypto-sasl-jdk1.4 (both, but order does not matter) 7) gcc-java 8) libgcj-devel 9) libgcj There's some weird %postun error when removing eclipse-ecj using this sequence, but that's probably unrelated and could be a missing dep elsewhere.
Created attachment 114830 [details] Debug output of "yum remove libgcj"
The relevant part for rpm is: D: ========== recording tsort relations D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth) D: 0 0 0 11 1 0 -eclipse-ecj-3.1.0_fc-0.M7.5.i386 D: ========== successors only (0 bytes) D: 1 0 0 0 1 1 -jessie-1.0.0-7.noarch D: 2 0 0 1 1 2 -gnu-crypto-jce-jdk1.4-2.0.1-1jpp_4fc.noarch D: 3 0 0 2 1 3 -gnu-crypto-sasl-jdk1.4-2.0.1-1jpp_4fc.noarch D: 4 0 0 3 1 4 -java-1.4.2-gcj-compat-1.4.2.0-40jpp_24rh.i386 D: 5 0 0 4 1 5 -gnu-crypto-2.0.1-1jpp_4fc.noarch D: 6 0 0 5 1 6 -libgcj-devel-4.0.0-8.i386 D: 7 0 0 6 1 7 -gcc-java-4.0.0-8.i386 D: 8 0 0 7 1 8 -ant-1.6.2-3jpp_8fc.i386 D: 9 0 0 8 1 9 -gjdoc-0.7.4-5.i386 D: 10 0 0 9 1 10 -libgcj-4.0.0-8.i386 D: 11 0 0 10 1 11 -java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp_24rh.i386 Running rpm -evv --test on the package set: D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth, breadth) D: 0 0 0 11 1 0 -gjdoc-0.7.4-5.i386 D: ========== successors only (0 bytes) D: 1 0 0 0 1 1 -libgcj-4.0.0-8.i386 D: 2 0 0 1 1 2 -java-1.4.2-gcj-compat-devel-1.4.2.0-40jpp_24rh.i386 D: 3 0 0 2 1 3 -eclipse-ecj-3.1.0_fc-0.M7.5.i386 D: 4 0 0 3 1 4 -jessie-1.0.0-7.noarch D: 5 0 0 4 1 5 -gnu-crypto-jce-jdk1.4-2.0.1-1jpp_4fc.noarch D: 6 0 0 5 1 6 -gnu-crypto-sasl-jdk1.4-2.0.1-1jpp_4fc.noarch D: 7 0 0 6 1 7 -java-1.4.2-gcj-compat-1.4.2.0-40jpp_24rh.i386 D: 8 0 0 7 1 8 -gnu-crypto-2.0.1-1jpp_4fc.noarch D: 9 0 0 8 1 9 -libgcj-devel-4.0.0-8.i386 D: 10 0 0 9 1 10 -gcc-java-4.0.0-8.i386 D: 11 0 0 10 1 11 -ant-1.6.2-3jpp_8fc.i386
Actually we need not to reverse them in rpm, plus an update for bug #155700
Dropped bogus yum patch
*** Bug 154069 has been marked as a duplicate of this bug. ***
*** Bug 135048 has been marked as a duplicate of this bug. ***
Fixed in rpm-4.4.6.