summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-07-18 03:52:13 +0000
committerZac Medico <zmedico@gentoo.org>2006-07-18 03:52:13 +0000
commitde2ffe652eec8d00db12eae891d524db9c89e626 (patch)
tree2b3f2c852f797d412702b77069027c704bb0cc4e /bin
parent2e93dbf5a3181abd47fc5529d07ed372bef3b462 (diff)
downloadportage-de2ffe652eec8d00db12eae891d524db9c89e626.tar.gz
portage-de2ffe652eec8d00db12eae891d524db9c89e626.tar.bz2
portage-de2ffe652eec8d00db12eae891d524db9c89e626.zip
Simplify generation of the cleanlist for depclean.
svn path=/main/trunk/; revision=3915
Diffstat (limited to 'bin')
-rwxr-xr-xbin/emerge34
1 files changed, 8 insertions, 26 deletions
diff --git a/bin/emerge b/bin/emerge
index 66bbcf6a1..9fc2daba8 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -3254,38 +3254,20 @@ def action_depclean(settings, trees, ldpath_mtimes,
reallist.append(catpack)
explicitly_required.add(x.split()[2])
+
+ sys_world_unversioned = set()
+ from itertools import chain
+ for x in chain(syslist, worldlist):
+ sys_world_unversioned.add(portage.dep_getkey(x))
+
cleanlist=[]
- clean_unversioned = []
for x in myvarlist:
if x not in explicitly_required:
- cleanlist.append(x)
- clean_unversioned.append(portage.dep_getkey(x))
-
- for x in syslist+worldlist:
- myparts = portage.catpkgsplit(x)
- if myparts:
- if myparts[0][0] in ('<','>','='):
- myparts[0] = myparts[0][1:]
- if myparts[0][0] in ('<','>','='):
- myparts[0] = myparts[0][1:]
- catpack=myparts[0]+"/"+myparts[1]
- else:
- catpack=x
- while True:
# We have to exempt all slots from the system and world sets since
# there's currently no way of knowing which slots the user may want
# to keep.
- try:
- idx = clean_unversioned.index(catpack) # raises ValueError
- del cleanlist[idx]
- del clean_unversioned[idx]
- except ValueError:
- break
-
- #print "\n\n\nCleaning: "
- #for x in cleanlist:
- # print x
- #print
+ if portage.dep_getkey(x) not in sys_world_unversioned:
+ cleanlist.append(x)
if len(cleanlist):
unmerge(settings, myopts, vartree, "unmerge", cleanlist, ldpath_mtimes)