For bug #183431, catch a ParseError caused by a corrupt profile and dump an error...
authorZac Medico <zmedico@gentoo.org>
Thu, 28 Jun 2007 04:58:54 +0000 (04:58 -0000)
committerZac Medico <zmedico@gentoo.org>
Thu, 28 Jun 2007 04:58:54 +0000 (04:58 -0000)
svn path=/main/branches/2.1.2/; revision=7074

pym/portage.py

index db7ddcabdbe59343dd261f785fa6495fe5b7ee2f..d56b494451ce502965f323519347383f75af9d68 100644 (file)
@@ -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))