Move the --regen code from global scope to a function.
authorZac Medico <zmedico@gentoo.org>
Thu, 22 Jun 2006 13:10:05 +0000 (13:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 22 Jun 2006 13:10:05 +0000 (13:10 -0000)
svn path=/main/trunk/; revision=3596

bin/emerge

index 65aa4bde34c6fd52019b9239ff8bccaecebeb803..a07eae625dd6e01aa4eb99c86d4eaf9dd1377fcf 100755 (executable)
@@ -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: