diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-06-28 04:57:05 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-06-28 04:57:05 +0000 |
commit | 24ee583e0c84a391bc0a0062724a57aebdc433b2 (patch) | |
tree | 2c15902787ea24ae7fb58b024924c1092527b904 | |
parent | 70157707e40df875c0cdba519dc84b66fa603219 (diff) | |
download | portage-24ee583e0c84a391bc0a0062724a57aebdc433b2.tar.gz portage-24ee583e0c84a391bc0a0062724a57aebdc433b2.tar.bz2 portage-24ee583e0c84a391bc0a0062724a57aebdc433b2.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.
svn path=/main/trunk/; revision=7073
-rw-r--r-- | pym/portage/__init__.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py index 2f9c8ee3c..4494af05f 100644 --- a/pym/portage/__init__.py +++ b/pym/portage/__init__.py @@ -1020,7 +1020,14 @@ class config(object): "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)) |