summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-06-22 14:40:15 +0000
committerZac Medico <zmedico@gentoo.org>2006-06-22 14:40:15 +0000
commitcbe3b0b03f673dd90860b79d0f2800061c2c1299 (patch)
treeb28b2ebe5d4b270488495315423ef75743d1f536
parente89835f9d4d918038dee4b83eb67b9dad09089b3 (diff)
downloadportage-cbe3b0b03f673dd90860b79d0f2800061c2c1299.tar.gz
portage-cbe3b0b03f673dd90860b79d0f2800061c2c1299.tar.bz2
portage-cbe3b0b03f673dd90860b79d0f2800061c2c1299.zip
Move emerge's default action code from global scope to a function.
svn path=/main/trunk/; revision=3603
-rwxr-xr-xbin/emerge56
1 files changed, 30 insertions, 26 deletions
diff --git a/bin/emerge b/bin/emerge
index a5c050e91..41c1df241 100755
--- a/bin/emerge
+++ b/bin/emerge
@@ -3464,32 +3464,7 @@ def action_depclean():
print "Number removed: "+str(len(cleanlist))
post_emerge()
-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:
- action_config()
-
-# INFO action
-elif "info"==myaction:
- action_info()
-
-# SEARCH action
-elif "search"==myaction:
- action_search()
-elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction:
- if 1 == unmerge(myaction, myfiles, raise_on_missing=False):
- post_emerge()
-
-elif "depclean"==myaction:
- action_depclean()
-# "update", "system", or just process files:
-else:
+def action_build(myopts):
favorites=[]
syslist=getlist("system")
if ("--ask" in myopts or "--pretend" in myopts) and not "--quiet" in myopts:
@@ -3657,3 +3632,32 @@ else:
+ " AUTOCLEAN is disabled. This can cause serious"
+ " problems due to overlapping packages.\n")
post_emerge()
+
+if __name__ == "__main__":
+ 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:
+ action_config()
+
+ # INFO action
+ elif "info"==myaction:
+ action_info()
+
+ # SEARCH action
+ elif "search"==myaction:
+ action_search()
+ elif "unmerge"==myaction or "prune"==myaction or "clean"==myaction:
+ if 1 == unmerge(myaction, myfiles, raise_on_missing=False):
+ post_emerge()
+
+ elif "depclean"==myaction:
+ action_depclean()
+ # "update", "system", or just process files:
+ else:
+ action_build(myopts)