summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-11-06 22:01:51 -0800
committerZac Medico <zmedico@gentoo.org>2011-11-06 22:01:51 -0800
commit9929eaf3e50897c814062bec5a704898e085d048 (patch)
tree38ebb0ce0accfea7bac50e136566d397aeabbc56
parent49a5cda809e55352d45395a6585d66c91f5e91ba (diff)
downloadportage-9929eaf3e50897c814062bec5a704898e085d048.tar.gz
portage-9929eaf3e50897c814062bec5a704898e085d048.tar.bz2
portage-9929eaf3e50897c814062bec5a704898e085d048.zip
Add emerge --moo action for bug #389609.
-rw-r--r--pym/_emerge/main.py41
1 files changed, 25 insertions, 16 deletions
diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py
index 52e4c4286..d4a6bd30f 100644
--- a/pym/_emerge/main.py
+++ b/pym/_emerge/main.py
@@ -97,6 +97,21 @@ shortmapping={
"v":"--verbose", "V":"--version"
}
+COWSAY_MOO = """
+
+ Larry loves Gentoo (%s)
+
+ _______________________
+< Have you mooed today? >
+ -----------------------
+ \ ^__^
+ \ (oo)\_______
+ (__)\ )\/\
+ ||----w |
+ || ||
+
+"""
+
def chk_updated_info_files(root, infodirs, prev_mtimes, retval):
if os.path.exists("/usr/bin/install-info"):
@@ -592,7 +607,7 @@ def parse_opts(tmpcmdline, silent=False):
actions = frozenset([
"clean", "check-news", "config", "depclean", "help",
- "info", "list-sets", "metadata",
+ "info", "list-sets", "metadata", "moo",
"prune", "regen", "search",
"sync", "unmerge", "version",
])
@@ -1704,20 +1719,11 @@ def emerge_main(args=None):
del mytrees, mydb
if "moo" in myfiles:
- print("""
-
- Larry loves Gentoo (""" + platform.system() + """)
-
- _______________________
-< Have you mooed today? >
- -----------------------
- \ ^__^
- \ (oo)\_______
- (__)\ )\/\
- ||----w |
- || ||
-
-""")
+ print(COWSAY_MOO % platform.system())
+ msg = ("The above `emerge moo` display is deprecated. "
+ "Please use `emerge --moo` instead.")
+ for line in textwrap.wrap(msg, 50):
+ print(" %s %s" % (colorize("WARN", "*"), line))
for x in myfiles:
ext = os.path.splitext(x)[1]
@@ -1726,7 +1732,10 @@ def emerge_main(args=None):
break
root_config = trees[settings['EROOT']]['root_config']
- if myaction == "list-sets":
+ if myaction == "moo":
+ print(COWSAY_MOO % platform.system())
+ return os.EX_OK
+ elif myaction == "list-sets":
writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
return os.EX_OK
elif myaction == "check-news":