added pathInfo parsing of $shellVariables. These are now interpreted as absolute path (used to be wrongly considered relative...)

This commit is contained in:
Philip Eisenlohr 2013-02-01 11:30:57 +00:00
parent c2495d0d4a
commit 20060b4275
1 changed files with 6 additions and 2 deletions

View File

@ -41,8 +41,12 @@ class Environment():
for line in content:
if not (line.startswith('#') or line == ''):
items = line.split() + ['','']
self.pathInfo[items[0].lower()] = {False: os.path.normpath(os.path.join(self.relPath('lib/'),items[1])),
True: items[1]}[items[1] == '']
if items[1] == '': # nothing specified
self.pathInfo[items[0].lower()] = ''
elif items[1].startswith(('/','$')): # absolute path specified ($shellVar is considered absolute)
self.pathInfo[items[0].lower()] = items[1]
else: # path relative to DAMASK_ROOT/lib
self.pathInfo[items[0].lower()] = os.path.normpath(os.path.join(self.relPath('lib/'),items[1]))
except:
pass