now aware of $DAMASK_BIN and guessing if environment missing

This commit is contained in:
Philip Eisenlohr 2011-11-09 17:51:00 +00:00
parent eebb59d146
commit 44e5d25274
1 changed files with 47 additions and 45 deletions

View File

@ -60,17 +60,19 @@ execute = { \
} }
homedir = os.getenv('HOME') homedir = os.getenv('HOME')
#basedir = os.path.join(os.path.dirname(sys.argv[0]),'..')
damask_root = os.getenv('DAMASK_ROOT') damask_root = os.getenv('DAMASK_ROOT')
basedir = os.getenv('DAMASK_ROOT')+'/processing/' if damask_root == '' or damask_root == None: damask_root = os.path.join(os.path.dirname(sys.argv[0]),'../../')
damask_bin = os.getenv('DAMASK_BIN')
if damask_bin == '' or damask_bin == None: damask_bin = os.path.join(damask_root,'bin/')
basedir = os.path.join(damask_root,'processing/')
for dir in bin_link: for dir in bin_link:
for file in bin_link[dir]: for file in bin_link[dir]:
src = os.path.abspath(os.path.join(basedir,dir,file)) src = os.path.abspath(os.path.join(basedir,dir,file))
if (file == ''): if (file == ''):
sym_link = os.path.abspath(os.path.join(damask_root,'bin',dir)) sym_link = os.path.abspath(os.path.join(damask_bin,dir))
else: else:
sym_link = os.path.abspath(os.path.join(damask_root,'bin',os.path.splitext(file)[0])) sym_link = os.path.abspath(os.path.join(damask_bin,os.path.splitext(file)[0]))
print sym_link,'-->',src print sym_link,'-->',src
if os.path.lexists(sym_link): if os.path.lexists(sym_link):
os.remove(sym_link) os.remove(sym_link)