From 4962abc30cfa078d16a0dd19166a08de1ae6e57d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Thu, 22 Jun 2006 12:59:19 +0000 Subject: Move the --sync and --metadata code from global scope to a function. svn path=/main/trunk/; revision=3595 --- bin/emerge | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'bin') 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 -- cgit v1.2.3-1-g7c22