summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorMarius Mauch <genone@gentoo.org>2007-12-04 10:14:38 +0000
committerMarius Mauch <genone@gentoo.org>2007-12-04 10:14:38 +0000
commitf125904b85b7d59cfa7ecb65b878228a6d6fd6b6 (patch)
treeaf4aa1411ba36c45e42c6ed6ba3ac1d05731681b /pym
parent13a40f3fc26f86a935139111be40380514d8f301 (diff)
downloadportage-f125904b85b7d59cfa7ecb65b878228a6d6fd6b6.tar.gz
portage-f125904b85b7d59cfa7ecb65b878228a6d6fd6b6.tar.bz2
portage-f125904b85b7d59cfa7ecb65b878228a6d6fd6b6.zip
perform sanity checks for set configuration even if myaction is None
svn path=/main/trunk/; revision=8840
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py11
-rw-r--r--pym/portage/sets/__init__.py2
2 files changed, 7 insertions, 6 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 0d97e6190..3fa8f1769 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6909,14 +6909,14 @@ def emerge_main():
# only expand sets for actions taking package arguments
oldargs = myfiles[:]
- if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge"):
+ if myaction in ("clean", "config", "depclean", "info", "prune", "unmerge", None):
root_config = trees[settings["ROOT"]]["root_config"]
setconfig = root_config.setconfig
sets = root_config.sets
# emerge relies on the existance of sets with names "world" and "system"
for s in ("world", "system"):
if s not in sets:
- print "emerge: incomplete set configuration, no set defined for \"%s\"" % s
+ print "emerge: incomplete set configuration, no \"%s\" set defined" % s
print " sets defined: %s" % ", ".join(sets)
return 1
newargs = []
@@ -6935,15 +6935,16 @@ def emerge_main():
print "emerge: there are no sets to satisfy %s." % \
colorize("INFORM", s)
return 1
- # TODO: check if the current setname also resolves to a package name
if myaction in ["unmerge", "prune", "clean", "depclean"] and \
- not sets[s].supportsOperation("unmerge"):
+ not sets[s].supportsOperation("unmerge"):
print "emerge: the given set %s does not support unmerge operations" % s
return 1
if not setconfig.getSetAtoms(s):
print "emerge: '%s' is an empty set" % s
- else:
+ elif action != None:
newargs.extend(setconfig.getSetAtoms(s))
+ else:
+ newargs.append(SETPREFIX+s)
for e in sets[s].errors:
print e
else:
diff --git a/pym/portage/sets/__init__.py b/pym/portage/sets/__init__.py
index d92eb3130..2d36f4814 100644
--- a/pym/portage/sets/__init__.py
+++ b/pym/portage/sets/__init__.py
@@ -83,7 +83,7 @@ class SetConfig(SafeConfigParser):
ignorelist = set()
ignorelist.add(setname)
for n in myset.getNonAtoms():
- if n[0] == SETPREFIX and n[1:] in self.psets
+ if n[0] == SETPREFIX and n[1:] in self.psets:
if n[1:] not in ignorelist:
myatoms.update(self.getSetAtoms(n[1:],
ignorelist=ignorelist))