From f3ad5788ae2b1c08890226a8d5177b8b5ffdbe65 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 22 Jun 2006 13:10:05 +0000 Subject: Move the --regen code from global scope to a function. svn path=/main/trunk/; revision=3596 --- bin/emerge | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'bin') 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: -- cgit v1.2.3-1-g7c22