Description of problem: There is a problem with 'yum groupremove' command. When packages PA, PB, PC is depending on PP, and %preun/%postun of PA,PB,PC are referring to files in PP, and all 4 packages are in one RPM group, the 'yum groupremove <RPM group>' command will fail. I've tried to enabled requires, requires(pre), requires(post), requires(preun), requires(post) in spec files and rebuilt all packages PA, PB, PC, but that doesn't help neither. The regular 'rpm -e PA PB PC PP' command doesn't report any problems in fact which probably sorts out the package removal sequence automatically. But the 'yum groupremove <RPM group>' command fails. The packages removal sequence of 'yum groupremove' is: 1, PA 2, PP 3, PB 4, PC So PB and PC's %preun|%postun reports failure because they are referring to files in PP which is already removed before! Version-Release number of selected component (if applicable): yum-3.2.20-5.fc10.noarch How reproducible: always Steps to Reproduce: 1. # yum -y --disablerepo=\* --enablerepo=correct-groupremove-order groupinfo correct-groupremove-order ... Group: correct-groupremove-order Default Packages: test-PA test-PB test-PC test-PP 2. # yum -y --disablerepo=\* --enablerepo=correct-groupremove-order groupinstall correct-groupremove-order ... Installed: test-PA.x86_64 0:0.1-1 test-PB.x86_64 0:0.1-1 test-PC.x86_64 0:0.1-1 test-PP.x86_64 0:0.1-1 Complete! 3. # yum -y --disablerepo=\* --enablerepo=correct-groupremove-order groupremove correct-groupremove-order Actual results: # yum -y --disablerepo=\* --enablerepo=correct-groupremove-order groupremove correct-groupremove-order ... Running Transaction This is a test Erasing : test-PA 1/4 This is a test Erasing : test-PP 2/4 cat: /usr/share/test/test-PP.txt: No such file or directory cat: /usr/share/test/test-PP.txt: No such file or directory =============================== Leaving rpm code =============================== Removed: test-PA.x86_64 0:0.1-1 test-PB.x86_64 0:0.1-1 test-PC.x86_64 0:0.1-1 test-PP.x86_64 0:0.1-1 Complete! # echo $? 1 # rpm -q test-PA test-PB test-PC test-PP package test-PA is not installed test-PB-0.1-1.x86_64 test-PC-0.1-1.x86_64 package test-PP is not installed Expected results: yum should remove all packages (without errors) Additional info: I do not think this is the rpm's bug although it happens in "rpm code", because rpm works as expected: # rpm -q test-PA test-PB test-PC test-PPtest-PA-0.1-1.x86_64 test-PB-0.1-1.x86_64 test-PC-0.1-1.x86_64 test-PP-0.1-1.x86_64 # rpm -e test-PP test-PA test-PB test-PC This is a test This is a test This is a test This is a test This is a test This is a test # echo $? 0 # rpm -q test-PA test-PB test-PC test-PP package test-PA is not installed package test-PB is not installed package test-PC is not installed package test-PP is not installed
Created attachment 328204 [details] packaged repo I have used for testing $ rpm -qpl repo/test-PP-0.1-1.x86_64.rpm /usr/share/test /usr/share/test/test-PP.txt $ rpm -qp --requires repo/test-P{A,B,C}*.x86_64.rpm | grep test-PP test-PP test-PP test-PP $ rpm -qp --scripts repo/test-P{A,B,C}*.x86_64.rpm preinstall program: /bin/sh postinstall program: /bin/sh preuninstall scriptlet (using /bin/sh): cat /usr/share/test/test-PP.txt postuninstall scriptlet (using /bin/sh): cat /usr/share/test/test-PP.txt preinstall program: /bin/sh postinstall program: /bin/sh preuninstall scriptlet (using /bin/sh): cat /usr/share/test/test-PP.txt postuninstall scriptlet (using /bin/sh): cat /usr/share/test/test-PP.txt preinstall program: /bin/sh postinstall program: /bin/sh preuninstall scriptlet (using /bin/sh): cat /usr/share/test/test-PP.txt postuninstall scriptlet (using /bin/sh): cat /usr/share/test/test-PP.txt
Ordering of the transaction isn't done by yum. It's done by ts.order() internal to rpm/rpm-python. Are you sure this is specific to groupremove?
Heh, just tried and it is not - it fails with yum remove as well: # rpm -q test-PA test-PB test-PC test-PPtest-PA-0.1-1.x86_64 test-PB-0.1-1.x86_64 test-PC-0.1-1.x86_64 test-PP-0.1-1.x86_64 # yum -y remove test-PA test-PP test-PB test-PC ... Running Transaction This is a test Erasing : test-PA 1/4 This is a test Erasing : test-PP 2/4 cat: /usr/share/test/test-PP.txt: No such file or directory cat: /usr/share/test/test-PP.txt: No such file or directory =============================== Leaving rpm code =============================== Removed: test-PA.x86_64 0:0.1-1 test-PB.x86_64 0:0.1-1 test-PC.x86_64 0:0.1-1 test-PP.x86_64 0:0.1-1 Complete! # rpm -q test-PA test-PB test-PC test-PP package test-PA is not installed test-PB-0.1-1.x86_64 test-PC-0.1-1.x86_64 package test-PP is not installed And when I try with parameters order which should work: # yum -y remove test-PA test-PB test-PC test-PP ... Running Transaction This is a test Erasing : test-PA 1/4 This is a test Erasing : test-PP 2/4 cat: /usr/share/test/test-PP.txt: No such file or directory cat: /usr/share/test/test-PP.txt: No such file or directory =============================== Leaving rpm code =============================== Removed: test-PA.x86_64 0:0.1-1 test-PB.x86_64 0:0.1-1 test-PC.x86_64 0:0.1-1 test-PP.x86_64 0:0.1-1 Complete!
Unlikely to get fixed in rpm 4.6.x so marking as a dupe... *** This bug has been marked as a duplicate of bug 479257 ***