From: Zac Medico Date: Thu, 22 Jun 2006 12:59:19 +0000 (-0000) Subject: Move the --sync and --metadata code from global scope to a function. X-Git-Tag: v2.1.1~442 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4962abc30cfa078d16a0dd19166a08de1ae6e57d;p=portage.git Move the --sync and --metadata code from global scope to a function. svn path=/main/trunk/; revision=3595 --- diff --git a/bin/emerge b/bin/emerge index ec81f8be1..65aa4bde3 100755 --- a/bin/emerge +++ b/bin/emerge @@ -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