summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-10-16 14:47:57 +0000
committerMarius Mauch <genone@gentoo.org>2007-10-16 14:47:57 +0000
commitef924140dda36ea67379b8f17d01e8324d802acf (patch)
tree5cbbf4521724752a8779105afed4e26827684aa7
parent4ae64b238d7f55f44a6d24ea392756d9c3521b6c (diff)
downloadportage-ef924140dda36ea67379b8f17d01e8324d802acf.tar.gz
portage-ef924140dda36ea67379b8f17d01e8324d802acf.tar.bz2
portage-ef924140dda36ea67379b8f17d01e8324d802acf.zip
Replace getlist() with PackageSet.getAtoms()
svn path=/main/trunk/; revision=8145
-rw-r--r--pym/_emerge/__init__.py35
1 files changed, 2 insertions, 33 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index d2e4ff563..1fcc1fb0d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -560,37 +560,6 @@ class search(object):
return result
-#build our package digraph
-def getlist(settings, mode):
- if mode=="system":
- mylines = settings.packages
- elif mode=="world":
- try:
- file_path = os.path.join(settings["ROOT"], portage.WORLD_FILE)
- myfile = open(file_path, "r")
- mylines = myfile.readlines()
- myfile.close()
- except (OSError, IOError), e:
- if e.errno == errno.ENOENT:
- portage.writemsg("\n!!! World file does not exist: '%s'\n" % file_path)
- mylines=[]
- else:
- raise
- mynewlines=[]
- for x in mylines:
- myline=" ".join(x.split())
- if not len(myline):
- continue
- elif myline[0]=="#":
- continue
- elif mode=="system":
- if myline[0]!="*":
- continue
- myline=myline[1:]
- mynewlines.append(myline.strip())
-
- return mynewlines
-
def clean_world(vardb, cpv):
"""Remove a package from the world file when unmerged."""
world_set = WorldSet(vardb.settings["ROOT"])
@@ -4240,7 +4209,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
try:
if os.access(vdb_path, os.W_OK):
vdb_lock = portage.locks.lockdir(vdb_path)
- realsyslist = getlist(settings, "system")
+ realsyslist = settings.setconfig.getSetsWithAliases()["system"].getAtoms()
syslist = []
for x in realsyslist:
mycp = portage.dep_getkey(x)
@@ -4275,7 +4244,7 @@ def unmerge(settings, myopts, vartree, unmerge_action, unmerge_files,
if not unmerge_files or "world" in unmerge_files:
candidate_catpkgs.extend(vartree.dbapi.cp_all())
elif "system" in unmerge_files:
- candidate_catpkgs.extend(getlist(settings, "system"))
+ candidate_catpkgs.extend(settings.setconfig.getSetsWithAliaes()["system"].getAtoms())
else:
#we've got command-line arguments
if not unmerge_files: