summaryrefslogtreecommitdiffstats
path: root/pym/portage.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-06-28 04:58:54 +0000
committerZac Medico <zmedico@gentoo.org>2007-06-28 04:58:54 +0000
commit361801e4b4ed59911763219da09608ca6bb02b6e (patch)
tree9ca2195e801675b8d99310cad7a012886fe35995 /pym/portage.py
parent06780db71fde5fecee9243660ffa484d17750bdf (diff)
downloadportage-361801e4b4ed59911763219da09608ca6bb02b6e.tar.gz
portage-361801e4b4ed59911763219da09608ca6bb02b6e.tar.bz2
portage-361801e4b4ed59911763219da09608ca6bb02b6e.zip
For bug #183431, catch a ParseError caused by a corrupt profile and dump an error message. This allows emerge to continue with actions that don't require a valid profile, such as --sync. (trunk r7073)
svn path=/main/branches/2.1.2/; revision=7074
Diffstat (limited to 'pym/portage.py')
-rw-r--r--pym/portage.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index db7ddcabd..d56b49445 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1125,7 +1125,14 @@ class config:
"Parent '%s' not found: '%s'" % \
(parentPath, parentsFile))
self.profiles.append(currentPath)
- addProfile(os.path.realpath(self.profile_path))
+ try:
+ addProfile(os.path.realpath(self.profile_path))
+ except portage_exception.ParseError, e:
+ writemsg("!!! Unable to parse profile: '%s'\n" % \
+ self.profile_path, noiselevel=-1)
+ writemsg("!!! ParseError: %s\n" % str(e), noiselevel=-1)
+ del e
+ self.profiles = []
if local_config:
custom_prof = os.path.join(
config_root, CUSTOM_PROFILE_PATH.lstrip(os.path.sep))