Mercurial > hg > graal-compiler
diff mxtool/mx.py @ 10585:be8b942f448f
made parsing of mx/env more robust
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 01 Jul 2013 10:52:24 +0200 |
parents | aee899c96b0b |
children | 8ce168d68d49 8ab76b7c6ff6 |
line wrap: on
line diff
--- a/mxtool/mx.py Sun Jun 30 11:24:38 2013 -0400 +++ b/mxtool/mx.py Mon Jul 01 10:52:24 2013 +0200 @@ -606,12 +606,15 @@ e = join(mxDir, 'env') if exists(e): with open(e) as f: + lineNum = 0 for line in f: + lineNum = lineNum + 1 line = line.strip() if len(line) != 0 and line[0] != '#': + if not '=' in line: + abort(e + ':' + str(lineNum) + ': line does not match pattern "key=value"') key, value = line.split('=', 1) os.environ[key.strip()] = expandvars_in_property(value.strip()) - def _post_init(self, opts): mxDir = join(self.dir, 'mx') self._load_projects(mxDir)