summaryrefslogtreecommitdiffstats
path: root/pym/_emerge/main.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-07-03 19:13:59 +0000
committerZac Medico <zmedico@gentoo.org>2009-07-03 19:13:59 +0000
commit0bab68e3df2061ce1f4d46a69e3ddeccd7199e0f (patch)
treebe6c83bf7de1e26f5905ea0212e13bc7c5833a2d /pym/_emerge/main.py
parentff7e01832ad4bf8b07730b7c8009654e2db22bb9 (diff)
downloadportage-0bab68e3df2061ce1f4d46a69e3ddeccd7199e0f.tar.gz
portage-0bab68e3df2061ce1f4d46a69e3ddeccd7199e0f.tar.bz2
portage-0bab68e3df2061ce1f4d46a69e3ddeccd7199e0f.zip
Make --help into an action, and move --help --sync output to the
actions section. Thanks to Marat Radchenko <slonopotamusorama@gmail.com> for this patch. svn path=/main/trunk/; revision=13766
Diffstat (limited to 'pym/_emerge/main.py')
-rw-r--r--pym/_emerge/main.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 087493c4d..697647fdd 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -54,7 +54,7 @@ options=[
"--emptytree",
"--fetchonly", "--fetch-all-uri",
"--getbinpkg", "--getbinpkgonly",
-"--help", "--ignore-default-opts",
+"--ignore-default-opts",
"--keep-going",
"--noconfmem",
"--newuse",
@@ -203,7 +203,6 @@ def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
if icount > 0:
out.einfo("Processed %d info files." % (icount,))
-
def display_preserved_libs(vardbapi):
MAX_DISPLAY = 3
@@ -274,11 +273,10 @@ def display_preserved_libs(vardbapi):
print colorize("WARN", " * ") + " used by %d other files" % (len(consumers) - MAX_DISPLAY)
print "Use " + colorize("GOOD", "emerge @preserved-rebuild") + " to rebuild packages using these libraries"
-
def post_emerge(root_config, myopts, mtimedb, retval):
"""
Misc. things to run at the end of a merge session.
-
+
Update Info Files
Update Config Files
Update News Items
@@ -347,14 +345,13 @@ def post_emerge(root_config, myopts, mtimedb, retval):
portage.locks.unlockdir(vdb_lock)
chk_updated_cfg_files(target_root, config_protect)
-
+
display_news_notification(root_config, myopts)
if retval in (None, os.EX_OK) or (not "--pretend" in myopts):
display_preserved_libs(vardbapi)
sys.exit(retval)
-
def multiple_actions(action1, action2):
sys.stderr.write("\n!!! Multiple actions requested... Please choose one only.\n")
sys.stderr.write("!!! '%s' or '%s'\n\n" % (action1, action2))
@@ -439,7 +436,7 @@ def parse_opts(tmpcmdline, silent=False):
global options, shortmapping
actions = frozenset([
- "clean", "config", "depclean",
+ "clean", "config", "depclean", "help",
"info", "list-sets", "metadata",
"prune", "regen", "search",
"sync", "unmerge", "version",
@@ -666,7 +663,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
IS_OPERATOR = "/@"
DIFF_OPERATOR = "-@"
UNION_OPERATOR = "+@"
-
+
for i in range(0, len(myfiles)):
if myfiles[i].startswith(SETPREFIX):
start = 0
@@ -679,7 +676,7 @@ def expand_set_arguments(myfiles, myaction, root_config):
if start > 0 and start < end:
namepart = x[:start]
argpart = x[start+1:end]
-
+
# TODO: implement proper quoting
args = argpart.split(",")
options = {}
@@ -696,13 +693,13 @@ def expand_set_arguments(myfiles, myaction, root_config):
newset += x
x = ""
myfiles[i] = SETPREFIX+newset
-
+
sets = setconfig.getSets()
# display errors that occured while loading the SetConfig instance
for e in setconfig.errors:
print colorize("BAD", "Error during set creation: %s" % e)
-
+
# emerge relies on the existance of sets with names "world" and "system"
required_sets = ("world", "system")
missing_sets = []
@@ -870,9 +867,9 @@ def config_protect_check(trees):
writemsg_level(msg, level=logging.WARN, noiselevel=-1)
def profile_check(trees, myaction, myopts):
- if myaction in ("info", "sync"):
+ if myaction in ("help", "info", "sync"):
return os.EX_OK
- elif "--version" in myopts or "--help" in myopts:
+ elif "--version" in myopts:
return os.EX_OK
for root, root_trees in trees.iteritems():
if root_trees["root_config"].settings.profiles:
@@ -1082,8 +1079,8 @@ def emerge_main():
settings.profile_path, settings["CHOST"],
trees[settings["ROOT"]]["vartree"].dbapi)
return 0
- elif "--help" in myopts:
- _emerge.help.help(myaction, myopts, portage.output.havecolor)
+ elif myaction == "help":
+ _emerge.help.help(myopts, portage.output.havecolor)
return 0
if "--debug" in myopts: