summaryrefslogtreecommitdiff
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-12 03:17:13 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-12 03:17:13 +0000
commitb10afa45d5cf97d47fc2e7bf7c7939996b83cb94 (patch)
tree9473dd155b73382fcb8451ea5a0926324251e1cc /pym
parentdrop lazy bindings check once and for all ... the system ldso should have the... (diff)
downloadportage-multirepo-b10afa45d5cf97d47fc2e7bf7c7939996b83cb94.tar.gz
portage-multirepo-b10afa45d5cf97d47fc2e7bf7c7939996b83cb94.tar.bz2
portage-multirepo-b10afa45d5cf97d47fc2e7bf7c7939996b83cb94.zip
For bug #147512, don't print a cryptic error message when an EnvironmentError occurs. Also, allow the user to get a traceback via --debug.
svn path=/main/trunk/; revision=5580
Diffstat (limited to 'pym')
-rw-r--r--pym/portage.py33
1 files changed, 23 insertions, 10 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 0952bd5f..be8f58e5 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -895,6 +895,8 @@ class config:
@type local_config: Boolean
"""
+ debug = os.environ.get("PORTAGE_DEBUG") == "1"
+
self.already_in_regenerate = 0
self.locked = 0
@@ -1134,9 +1136,12 @@ class config:
except SystemExit, e:
raise
except Exception, e:
+ if debug:
+ raise
writemsg("!!! %s\n" % (e), noiselevel=-1)
- writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n", noiselevel=-1)
- writemsg("!!! Errors in this file should be reported on bugs.gentoo.org.\n")
+ if not isinstance(e, EnvironmentError):
+ writemsg("!!! Incorrect multiline literals can cause " + \
+ "this. Do not use them.\n", noiselevel=-1)
sys.exit(1)
self.configlist.append(self.mygcfg)
self.configdict["globals"]=self.configlist[-1]
@@ -1158,13 +1163,18 @@ class config:
except SystemExit, e:
raise
except Exception, e:
+ if debug:
+ raise
writemsg("!!! %s\n" % (e), noiselevel=-1)
- writemsg("!!! 'rm -Rf /usr/portage/profiles; emerge sync' may fix this. If it does\n",
- noiselevel=-1)
- writemsg("!!! not then please report this to bugs.gentoo.org and, if possible, a dev\n",
- noiselevel=-1)
- writemsg("!!! on #gentoo (irc.freenode.org)\n",
- noiselevel=-1)
+ if not isinstance(e, EnvironmentError):
+ writemsg("!!! 'rm -Rf /usr/portage/profiles; " + \
+ "emerge sync' may fix this. If it does\n",
+ noiselevel=-1)
+ writemsg("!!! not then please report this to " + \
+ "bugs.gentoo.org and, if possible, a dev\n",
+ noiselevel=-1)
+ writemsg("!!! on #gentoo (irc.freenode.org)\n",
+ noiselevel=-1)
sys.exit(1)
self.configlist.append(self.mygcfg)
self.configdict["defaults"]=self.configlist[-1]
@@ -1178,9 +1188,12 @@ class config:
except SystemExit, e:
raise
except Exception, e:
+ if debug:
+ raise
writemsg("!!! %s\n" % (e), noiselevel=-1)
- writemsg("!!! Incorrect multiline literals can cause this. Do not use them.\n",
- noiselevel=-1)
+ if not isinstance(e, EnvironmentError):
+ writemsg("!!! Incorrect multiline literals can cause " + \
+ "this. Do not use them.\n", noiselevel=-1)
sys.exit(1)
# Allow ROOT setting to come from make.conf if it's not overridden