For bug #183431, catch a ParseError caused by a corrupt profile and dump an error...
authorZac Medico <zmedico@gentoo.org>
Mon, 30 Jul 2007 05:17:28 +0000 (05:17 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 30 Jul 2007 05:17:28 +0000 (05:17 -0000)
svn path=/main/branches/2.1.2.9/; revision=7486

pym/portage.py

index 3f07785f89c2d4df65131dd9827c360f6407b6ad..e8c079d066e95bfef6ceac9ea2ae08835a8549cc 100644 (file)
@@ -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))