Catch ParseError from getconfig during env_update for bug #142157.
authorZac Medico <zmedico@gentoo.org>
Mon, 31 Jul 2006 01:51:11 +0000 (01:51 -0000)
committerZac Medico <zmedico@gentoo.org>
Mon, 31 Jul 2006 01:51:11 +0000 (01:51 -0000)
svn path=/main/trunk/; revision=4050

pym/portage.py
pym/portage_util.py

index b0c6b1102c681fe74a77030e407e1d8d790c67bb..e2456d280a3d9924f6d93005c0966430f2a45c8c 100644 (file)
@@ -494,10 +494,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 7a37d980d1fd3e17fff412e6e24d7c5e522dae8e..bdd934ec3baefe378c0b07b778fb2b195d31e3b9 100644 (file)
@@ -279,7 +279,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