diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-07-31 16:48:04 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-07-31 16:48:04 +0000 |
commit | 97b4c368fba64aaa09fe018b04a9dfac993b6194 (patch) | |
tree | 2dd2506d83f69aa0e11258b775324b42a2c4774b | |
parent | af166550fdc92c596d0345ff62f2cb3605a045c6 (diff) | |
download | portage-97b4c368fba64aaa09fe018b04a9dfac993b6194.tar.gz portage-97b4c368fba64aaa09fe018b04a9dfac993b6194.tar.bz2 portage-97b4c368fba64aaa09fe018b04a9dfac993b6194.zip |
Catch ParseError from getconfig during env_update for bug #142157. This patch is from trunk r4050.
svn path=/main/branches/2.1/; revision=4063
-rw-r--r-- | pym/portage.py | 9 | ||||
-rw-r--r-- | pym/portage_util.py | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/pym/portage.py b/pym/portage.py index 2a56ca3fd..c15b3e443 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -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(): diff --git a/pym/portage_util.py b/pym/portage_util.py index 329c0a389..889a82330 100644 --- a/pym/portage_util.py +++ b/pym/portage_util.py @@ -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 |