Bug 478842 - yum groupremove - removal sequence is random
Summary: yum groupremove - removal sequence is random
Keywords:
Status: CLOSED DUPLICATE of bug 479257
Alias: None
Product: Fedora
Classification: Fedora
Component: rpm
Version: 10
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Panu Matilainen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-01-05 15:28 UTC by Jan Hutař
Modified: 2014-01-21 23:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-18 17:16:30 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
packaged repo I have used for testing (8.82 KB, application/bzip2)
2009-01-05 15:34 UTC, Jan Hutař
no flags Details

Description Jan Hutař 2009-01-05 15:28:25 UTC
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

Comment 1 Jan Hutař 2009-01-05 15:34:09 UTC
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

Comment 2 seth vidal 2009-01-05 15:42:04 UTC
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?

Comment 3 Jan Hutař 2009-01-06 07:47:23 UTC
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!

Comment 4 Panu Matilainen 2009-06-18 17:16:30 UTC
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 ***


Note You need to log in before you can comment on or make changes to this bug.