Bug 448153 - ts.order() returns wrong packages erasing order for 'yum remove' and 'yum groupremove'
Summary: ts.order() returns wrong packages erasing order for 'yum remove' and 'yum gro...
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rpm
Version: 5.1
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Panu Matilainen
QA Contact:
: 215929 475183 541637 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2008-05-23 19:36 UTC by Robinson Tiemuqinke
Modified: 2011-11-05 20:31 UTC (History)
4 users (show)

Clone Of:
Last Closed: 2010-11-15 10:46:35 UTC

Attachments (Terms of Use)

Description Robinson Tiemuqinke 2008-05-23 19:36:43 UTC
Description of problem:
ts.order() returns wrong package removal order for yum remove/groupremove

Version-Release number of selected component (if applicable):

How reproducible:
  Every time.

Steps to Reproduce:
1. create 4 packages PA, PB, PC, PP, let PA, PB and PC depends(requires) 
package PP; Let the %preun scripts of PA, PB, PC refers to files in PP.
2. run 'yum install PA PB PC PP' to install all 4 packages. this will install 
all 4 packages without problems.

3. run 'yum remove PA PB PC PP' now, it will fails the operation: only PA, PP 
are removed, while the removal of PB and PC failed because the %preun scripts' 
failure of PB and PC. The reason is: the depended packge PP is removed before 
PB and PC and so gone the file(s) refered. 
Actual results:

 PA, PP removed; PB, PC failed. the remove operation returns wrong results.

Expected results:

 All PA, PB, PC and PP should be removed

Additional info:

 The ts.order() returns wrong results. 

 After the ts.orders() is run at line 470 in /usr/share/yum-cli/cli.py in 
debugging mode, the debugging code "for te in self.ts: print te" returns:

 'PP, PB, PC'

 Thi is good for installation/upgrade operation, but for removal operation, 
the correct sequence should be:

 'PB, PC, PP'

 because removal of PP will definitely fail PB, and PC.


 command line 'rpm -e PA PP PB PC' has reported no problems, but we need the 
python based 'yum remove' and 'yum groupremove' for automatic administration.
'yum groupremove' has the same problem as 'yum remove', which as skvidal of 
yum development said, due to the bug of ts.order() from rpm-python/rpm.

Comment 1 Panu Matilainen 2008-10-02 12:56:46 UTC
*** Bug 215929 has been marked as a duplicate of this bug. ***

Comment 2 Panu Matilainen 2008-12-08 15:01:58 UTC
*** Bug 475183 has been marked as a duplicate of this bug. ***

Comment 3 Panu Matilainen 2010-01-04 18:56:30 UTC
*** Bug 541637 has been marked as a duplicate of this bug. ***

Comment 4 Panu Matilainen 2010-11-15 10:46:35 UTC
Proper erasure ordering is implemented in RHEL 6 rpm. It is not however backportable to RHEL 5 due to the API changes it requires.

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