summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-01-06 21:14:33 +0000
committerZac Medico <zmedico@gentoo.org>2009-01-06 21:14:33 +0000
commitfa8a4c3afbe528c1f479b73efa25b269424f0283 (patch)
tree2dedd7122c19fbce309e7dd90b544753987a0a62
parentFix _setitem() to write the same format that's currently distributed in the (diff)
downloadportage-multirepo-fa8a4c3afbe528c1f479b73efa25b269424f0283.tar.gz
portage-multirepo-fa8a4c3afbe528c1f479b73efa25b269424f0283.tar.bz2
portage-multirepo-fa8a4c3afbe528c1f479b73efa25b269424f0283.zip
When the set configuration is incomplete, notify the user that this usually
means /usr/share/portage/config/sets.conf is missing or corrupt. svn path=/main/trunk/; revision=12384
-rw-r--r--pym/_emerge/__init__.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index d728d64f..c5c310b0 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -14326,15 +14326,29 @@ def expand_set_arguments(myfiles, myaction, root_config):
# emerge relies on the existance of sets with names "world" and "system"
required_sets = ("world", "system")
+ missing_sets = []
for s in required_sets:
if s not in sets:
- msg = ["emerge: incomplete set configuration, " + \
- "no \"%s\" set defined" % s]
+ missing_sets.append(s)
+ if missing_sets:
+ if len(missing_sets) > 2:
+ missing_sets_str = ", ".join('"%s"' % s for s in missing_sets[:-1])
+ missing_sets_str += ', and "%s"' % missing_sets[-1]
+ elif len(missing_sets) == 2:
+ missing_sets_str = '"%s" and "%s"' % tuple(missing_sets)
+ else:
+ missing_sets_str = '"%s"' % missing_sets[-1]
+ msg = ["emerge: incomplete set configuration, " + \
+ "missing set(s): %s" % missing_sets_str]
+ if sets:
msg.append(" sets defined: %s" % ", ".join(sets))
- for line in msg:
- sys.stderr.write(line + "\n")
- retval = 1
+ msg.append(" This usually means that '%s'" % \
+ (os.path.join(portage.const.GLOBAL_CONFIG_PATH, "sets.conf"),))
+ msg.append(" is missing or corrupt.")
+ for line in msg:
+ writemsg_level(line + "\n", level=logging.ERROR, noiselevel=-1)
+ return (None, 1)
unmerge_actions = ("unmerge", "prune", "clean", "depclean")
for a in myfiles: