summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-04-27 20:52:22 +0000
committerZac Medico <zmedico@gentoo.org>2008-04-27 20:52:22 +0000
commit14705faba9c742b8367f8aa176b6565081ad7f31 (patch)
tree1fdef3363e9bd615cf3071403503aba462a3970f
parent58788855b7eeca65bcb3cbc9ae83c7ba9b727733 (diff)
downloadportage-14705faba9c742b8367f8aa176b6565081ad7f31.tar.gz
portage-14705faba9c742b8367f8aa176b6565081ad7f31.tar.bz2
portage-14705faba9c742b8367f8aa176b6565081ad7f31.zip
* Remove the only remaining sys.exit() calls inside the depgraph class.
* Fix _unknown_internal_error() to work with zero arguments. svn path=/main/trunk/; revision=10005
-rw-r--r--pym/_emerge/__init__.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index 534c13a13..08bbeb9c1 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -2549,14 +2549,14 @@ class depgraph(object):
portage.writemsg("!!! to aid in the detection of malicious intent.\n\n")
portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF TAMPERED FILES -- CHECK CAREFULLY.\n")
portage.writemsg("!!! Affected file: %s\n" % (e), noiselevel=-1)
- sys.exit(1)
+ return 0, myfavorites
except portage.exception.InvalidSignature, e:
portage.writemsg("\n\n!!! An invalid gpg signature is preventing portage from calculating the\n")
portage.writemsg("!!! required dependencies. This is a security feature enabled by the admin\n")
portage.writemsg("!!! to aid in the detection of malicious intent.\n\n")
portage.writemsg("!!! THIS IS A POSSIBLE INDICATION OF TAMPERED FILES -- CHECK CAREFULLY.\n")
portage.writemsg("!!! Affected file: %s\n" % (e), noiselevel=-1)
- sys.exit(1)
+ return 0, myfavorites
except SystemExit, e:
raise # Needed else can't exit
except Exception, e:
@@ -3678,7 +3678,7 @@ class depgraph(object):
print
print "!!! Note that circular dependencies can often be avoided by temporarily"
print "!!! disabling USE flags that trigger optional dependencies."
- sys.exit(1)
+ raise self._unknown_internal_error()
# At this point, we've succeeded in selecting one or more nodes, so
# it's now safe to reset the prefer_asap and accept_root_node flags
@@ -4678,7 +4678,11 @@ class depgraph(object):
fakedb[myroot].cpv_inject(pkg)
self.spinner.update()
- class _unknown_internal_error(portage.exception.PortageException):
+ class _internal_exception(portage.exception.PortageException):
+ def __init__(self, value=""):
+ portage.exception.PortageException.__init__(self, value)
+
+ class _unknown_internal_error(_internal_exception):
"""
Used by the depgraph internally to terminate graph creation.
The specific reason for the failure should have been dumped
@@ -4686,7 +4690,7 @@ class depgraph(object):
may not be known.
"""
- class _serialize_tasks_retry(portage.exception.PortageException):
+ class _serialize_tasks_retry(_internal_exception):
"""
This is raised by the _serialize_tasks() method when it needs to
be called again for some reason. The only case that it's currently