Move the --sync and --metadata code from global scope to a function.
authorZac Medico <zmedico@gentoo.org>
Thu, 22 Jun 2006 12:59:19 +0000 (12:59 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 22 Jun 2006 12:59:19 +0000 (12:59 -0000)
svn path=/main/trunk/; revision=3595

bin/emerge

index ec81f8be1d2d5108a840465e8532934389c47d19..65aa4bde34c6fd52019b9239ff8bccaecebeb803 100755 (executable)
@@ -2725,11 +2725,7 @@ def validate_merge_list(mergelist):
 if "--debug" in myopts:
        edebug=1
 
-if myaction in ["sync","metadata"] and (not "--help" in myopts):
-       if "--pretend" in myopts:
-               print "emerge: \"sync\" actions do not support \"--pretend.\""
-               sys.exit(1)
-
+def action_sync():
        emergelog(" === "+str(myaction))
        myportdir=portage.settings["PORTDIR"]
        if myportdir[-1]=="/":
@@ -3168,6 +3164,12 @@ if myaction in ["sync","metadata"] and (not "--help" in myopts):
                print red(" * ")+"configuration files."
                print red(" * ")+"To update portage, run 'emerge portage'."
                print
+
+if myaction in ["sync","metadata"] and "--help" not in myopts:
+       if "--pretend" in myopts:
+               print "emerge: \"sync\" actions do not support \"--pretend.\""
+               sys.exit(1)
+       action_sync()
 elif myaction=="regen":
        emergelog(" === regen")
        #regenerate cache entries