Process help and version actions asap. Thanks to Brian Harring.
authorZac Medico <zmedico@gentoo.org>
Fri, 26 Mar 2010 22:51:25 +0000 (15:51 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 26 Mar 2010 22:51:25 +0000 (15:51 -0700)
pym/_emerge/main.py

index 27948e51b3e8363d9fcfe2da9c59f8f8164da6c4..3e89e2905565c550a3ec3db5003653da3ffec555 100644 (file)
@@ -1211,6 +1211,16 @@ def emerge_main():
        adjust_configs(myopts, trees)
        apply_priorities(settings)
 
+       if myaction == 'version':
+               writemsg_stdout(getportageversion(
+                       settings["PORTDIR"], settings["ROOT"],
+                       settings.profile_path, settings["CHOST"],
+                       trees[settings["ROOT"]]["vartree"].dbapi) + '\n', noiselevel=-1)
+               return 0
+       elif myaction == 'help':
+               _emerge.help.help(myopts, portage.output.havecolor)
+               return 0
+
        spinner = stdout_spinner()
        if "candy" in settings.features:
                spinner.update = spinner.update_scroll
@@ -1347,15 +1357,6 @@ def emerge_main():
                        not sys.stdout.isatty():
                        spinner.update = spinner.update_basic
 
-       if myaction == 'version':
-               print(getportageversion(settings["PORTDIR"], settings["ROOT"],
-                       settings.profile_path, settings["CHOST"],
-                       trees[settings["ROOT"]]["vartree"].dbapi))
-               return 0
-       elif myaction == "help":
-               _emerge.help.help(myopts, portage.output.havecolor)
-               return 0
-
        if "--debug" in myopts:
                print("myaction", myaction)
                print("myopts", myopts)