summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-10-24 01:59:42 +0000
committerZac Medico <zmedico@gentoo.org>2007-10-24 01:59:42 +0000
commit0b13295af4bb063184d5382f6a2192581ead12fd (patch)
tree01a7f621fca49433fe8c97ad27f1bbc686270f62 /pym
parent1342b456c4606dfe9ca5ff542af11cffbc491742 (diff)
downloadportage-0b13295af4bb063184d5382f6a2192581ead12fd.tar.gz
portage-0b13295af4bb063184d5382f6a2192581ead12fd.tar.bz2
portage-0b13295af4bb063184d5382f6a2192581ead12fd.zip
Replace sys.exit() calls with return statements in emerge_main().
svn path=/main/trunk/; revision=8266
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 44687c76e..cc88e395d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -6366,7 +6366,7 @@ def emerge_main():
# TODO: check if the current setname also resolves to a package name
if myaction in ["unmerge", "prune", "clean", "depclean"] and not packagesets[s].supportsOperation("unmerge"):
print "emerge: the given set %s does not support unmerge operations" % s
- sys.exit(1)
+ return 1
if not settings.sets[s].getAtoms():
print "emerge: '%s' is an empty set" % s
else:
@@ -6378,12 +6378,12 @@ def emerge_main():
# with the help message for empty argument lists
if oldargs and not myfiles:
print "emerge: no targets left after set expansion"
- sys.exit(0)
+ return 0
del oldargs
if ("--tree" in myopts) and ("--columns" in myopts):
print "emerge: can't specify both of \"--tree\" and \"--columns\"."
- sys.exit(1)
+ return 1
if ("--quiet" in myopts):
spinner.update = spinner.update_quiet
@@ -6433,7 +6433,7 @@ def emerge_main():
if ("--ask" in myopts) and (not sys.stdin.isatty()):
portage.writemsg("!!! \"--ask\" should only be used in a terminal. Exiting.\n",
noiselevel=-1)
- sys.exit(1)
+ return 1
if settings.get("PORTAGE_DEBUG", "") == "1":
spinner.update = spinner.update_quiet
@@ -6455,10 +6455,10 @@ def emerge_main():
print getportageversion(settings["PORTDIR"], settings["ROOT"],
settings.profile_path, settings["CHOST"],
trees[settings["ROOT"]]["vartree"].dbapi)
- sys.exit(0)
+ return 0
elif "--help" in myopts:
_emerge.help.help(myaction, myopts, portage.output.havecolor)
- sys.exit(0)
+ return 0
if "--debug" in myopts:
print "myaction", myaction
@@ -6466,7 +6466,7 @@ def emerge_main():
if not myaction and not myfiles and "--resume" not in myopts:
_emerge.help.help(myaction, myopts, portage.output.havecolor)
- sys.exit(1)
+ return 1
# check if root user is the current user for the actions where emerge needs this
if portage.secpass < 2: