summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-30 05:17:28 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-30 05:17:28 +0000
commit26ddda000ca1f678bf1e943d3f8a9588fbd17ca7 (patch)
tree340adb70c62848db181959a6b8360d60d317e4c4
parent78b8dc75cda318572cb9f3ad8595b2a9222a6e85 (diff)
downloadportage-26ddda000ca1f678bf1e943d3f8a9588fbd17ca7.tar.gz
portage-26ddda000ca1f678bf1e943d3f8a9588fbd17ca7.tar.bz2
portage-26ddda000ca1f678bf1e943d3f8a9588fbd17ca7.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. (branches/2.1.2 r7074)
svn path=/main/branches/2.1.2.9/; revision=7486
-rw-r--r--pym/portage.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 3f07785f8..e8c079d06 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -1099,7 +1099,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))