emerge: optimize --moo, remove deprecated moo
authorZac Medico <zmedico@gentoo.org>
Tue, 16 Oct 2012 23:15:46 +0000 (16:15 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 16 Oct 2012 23:15:46 +0000 (16:15 -0700)
The --moo action is fast like --help now. The "moo" argument has been
deprecated since bug #389609, and is now removed.

pym/_emerge/actions.py
pym/_emerge/main.py

index c403d8974fd2e82c83a8d3b6c8099ee9a0d3221c..fb80173c4bb61045978168893e1e4f6a3e3fa279 100644 (file)
@@ -87,21 +87,6 @@ if sys.hexversion >= 0x3000000:
 else:
        _unicode = unicode
 
-COWSAY_MOO = """
-
-  Larry loves Gentoo (%s)
-
- _______________________
-< Have you mooed today? >
- -----------------------
-        \   ^__^
-         \  (oo)\_______
-            (__)\       )\/\ 
-                ||----w |
-                ||     ||
-
-"""
-
 def action_build(settings, trees, mtimedb,
        myopts, myaction, myfiles, spinner):
 
@@ -3522,13 +3507,6 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
 
        del mytrees, mydb
 
-       if "moo" in myfiles:
-               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]
                if (ext == ".ebuild" or ext == ".tbz2") and \
@@ -3538,10 +3516,8 @@ def run_action(settings, trees, mtimedb, myaction, myopts, myfiles,
                        break
 
        root_config = trees[settings['EROOT']]['root_config']
-       if myaction == "moo":
-               print(COWSAY_MOO % platform.system())
-               return os.EX_OK
-       elif myaction == "list-sets":
+
+       if myaction == "list-sets":
                writemsg_stdout("".join("%s\n" % s for s in sorted(root_config.sets)))
                return os.EX_OK
        elif myaction == "check-news":
index d31d99ae4b2b09550a876bd40a6dc0c44c638ce5..ef91fc62d0e849231ad067cd4c1916f5e19e01bb 100644 (file)
@@ -3,6 +3,7 @@
 
 from __future__ import print_function
 
+import platform
 import sys
 
 import portage
@@ -67,6 +68,21 @@ shortmapping={
 "v":"--verbose",   "V":"--version"
 }
 
+COWSAY_MOO = """
+
+  Larry loves Gentoo (%s)
+
+ _______________________
+< Have you mooed today? >
+ -----------------------
+        \   ^__^
+         \  (oo)\_______
+            (__)\       )\/\ 
+                ||----w |
+                ||     ||
+
+"""
+
 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))
@@ -982,6 +998,9 @@ def emerge_main(args=None):
        if myaction == "help":
                emerge_help()
                return os.EX_OK
+       elif myaction == "moo":
+               print(COWSAY_MOO % platform.system())
+               return os.EX_OK
 
        # Portage needs to ensure a sane umask for the files it creates.
        os.umask(0o22)