diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-12-25 01:09:39 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-12-25 01:09:39 +0000 |
commit | d4ccdd7ebf5040f578a1a8589f4e0ea5370b1a67 (patch) | |
tree | 467951efaee051e33fe78d681c3b29542231fe37 /pym | |
parent | bf349977814ebd94ae03e36ba91538277184fce8 (diff) | |
download | portage-d4ccdd7ebf5040f578a1a8589f4e0ea5370b1a67.tar.gz portage-d4ccdd7ebf5040f578a1a8589f4e0ea5370b1a67.tar.bz2 portage-d4ccdd7ebf5040f578a1a8589f4e0ea5370b1a67.zip |
Fix --clean <atom> so that it considers all packages within a given slot when
it's deciding which packages to keep, rather than just considering the ones
matched by the given atom. Any packages not matching the given atom are protected
from being unmerged. Thanks to Mart Raudsepp <leio@g.o> for reporting.
(trunk r12272)
svn path=/main/branches/2.1.6/; revision=12306
Diffstat (limited to 'pym')
-rw-r--r-- | pym/_emerge/__init__.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 2fbd2d1a0..df61daead 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -11048,7 +11048,14 @@ def unmerge(root_config, myopts, unmerge_action, if myslot not in slotmap: slotmap[myslot] = {} slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)] = mypkg - + + for mypkg in vartree.dbapi.cp_list( + portage.dep_getkey(mymatch[0])): + myslot = vartree.getslot(mypkg) + if myslot not in slotmap: + slotmap[myslot] = {} + slotmap[myslot][vartree.dbapi.cpv_counter(mypkg)] = mypkg + for myslot in slotmap: counterkeys = slotmap[myslot].keys() if not counterkeys: @@ -11057,6 +11064,14 @@ def unmerge(root_config, myopts, unmerge_action, pkgmap[mykey]["protected"].add( slotmap[myslot][counterkeys[-1]]) del counterkeys[-1] + + for counter in counterkeys[:]: + mypkg = slotmap[myslot][counter] + if mypkg not in mymatch: + counterkeys.remove(counter) + pkgmap[mykey]["protected"].add( + slotmap[myslot][counter]) + #be pretty and get them in order of merge: for ckey in counterkeys: mypkg = slotmap[myslot][ckey] |