Catch ParseError from getconfig during env_update for bug #142157. This patch is...
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Jul 2006 16:48:04 +0000 (16:48 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Jul 2006 16:48:04 +0000 (16:48 -0000)
svn path=/main/branches/2.1/; revision=4063

pym/portage.py
pym/portage_util.py

index 2a56ca3fdeb26f239cd9a23d63d180a669b23173..c15b3e443031840b6b2127907299eb0be3d1c9cd 100644 (file)
@@ -559,10 +559,11 @@ def env_update(makelinks=1, target_root=None, prev_mtimes=None):
                if x[-1]=='~' or x[-4:]==".bak":
                        continue
                file_path = os.path.join(envd_dir, x)
-               myconfig = getconfig(file_path)
-               if myconfig is None:
-                       writemsg("!!! Parsing error in '%s'\n" % file_path, noiselevel=-1)
-                       #parse error
+               try:
+                       myconfig = getconfig(file_path)
+               except portage_exception.ParseError, e:
+                       writemsg("!!! '%s'\n" % str(e), noiselevel=-1)
+                       del e
                        continue
                # process PATH, CLASSPATH, LDPATH
                for myspec in specials.keys():
index 329c0a3896cffc09d5e7f175d89569dee71eff52..889a82330706902a4a71567a49939a1c0f2fb08b 100644 (file)
@@ -263,7 +263,7 @@ def getconfig(mycfg,tolerant=0,allow_sourcing=False):
        except SystemExit, e:
                raise
        except Exception, e:
-               raise e.__class__, str(e)+" in "+mycfg
+               raise portage_exception.ParseError(str(e)+" in "+mycfg)
        return mykeys
        
 #cache expansions of constant strings