From: Zac Medico Date: Thu, 22 Jun 2006 13:10:05 +0000 (-0000) Subject: Move the --regen code from global scope to a function. X-Git-Tag: v2.1.1~441 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f3ad5788ae2b1c08890226a8d5177b8b5ffdbe65;p=portage.git Move the --regen code from global scope to a function. svn path=/main/trunk/; revision=3596 --- diff --git a/bin/emerge b/bin/emerge index 65aa4bde3..a07eae625 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3165,12 +3165,7 @@ def action_sync(): 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": +def action_regen(): emergelog(" === regen") #regenerate cache entries print "Regenerating cache entries... " @@ -3195,6 +3190,14 @@ elif myaction=="regen": except Exception, e: print "\n error processing %(cpv)s, continuing... (%(e)s)" % {"cpv":y,"e":str(e)} print "done!" + +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": + action_regen() # HELP action elif "config"==myaction: if len(myfiles) != 1 or "system" in myfiles or "world" in myfiles: