2016-07-18 23:05:35 +05:30
|
|
|
#!/usr/bin/env python2.7
|
2014-04-02 00:11:14 +05:30
|
|
|
# -*- coding: UTF-8 no BOM -*-
|
|
|
|
|
2014-04-29 20:13:04 +05:30
|
|
|
import os,sys
|
2014-01-11 18:16:30 +05:30
|
|
|
import damask
|
|
|
|
|
|
|
|
bin_link = { \
|
|
|
|
'.' : [
|
|
|
|
'DAMASK_spectral.exe',
|
2014-09-10 13:39:35 +05:30
|
|
|
'DAMASK_FEM.exe'
|
2014-01-11 18:16:30 +05:30
|
|
|
],
|
|
|
|
}
|
|
|
|
|
2016-08-25 21:38:19 +05:30
|
|
|
MarcReleases =[ \
|
|
|
|
'2014',
|
|
|
|
'2014.2',
|
|
|
|
'2015',
|
2016-10-28 12:46:20 +05:30
|
|
|
'2016'
|
2016-08-25 21:38:19 +05:30
|
|
|
]
|
2014-01-11 18:16:30 +05:30
|
|
|
|
2016-07-14 18:39:25 +05:30
|
|
|
damaskEnv = damask.Environment()
|
|
|
|
baseDir = damaskEnv.relPath('code/')
|
|
|
|
binDir = damaskEnv.options['DAMASK_BIN']
|
2014-02-28 13:17:11 +05:30
|
|
|
|
|
|
|
if not os.path.isdir(binDir):
|
|
|
|
os.mkdir(binDir)
|
2014-01-11 18:16:30 +05:30
|
|
|
|
2016-08-25 21:38:19 +05:30
|
|
|
sys.stdout.write('\nsymbolic linking...\n')
|
|
|
|
|
|
|
|
for subDir in bin_link:
|
|
|
|
theDir = os.path.abspath(os.path.join(baseDir,subDir))
|
|
|
|
sys.stdout.write('\n'+binDir+' ->\n'+theDir+damask.util.deemph(' ...')+'\n')
|
|
|
|
|
|
|
|
for theFile in bin_link[subDir]:
|
|
|
|
theName,theExt = os.path.splitext(theFile)
|
|
|
|
src = os.path.abspath(os.path.join(theDir,theFile))
|
|
|
|
|
2014-01-11 18:16:30 +05:30
|
|
|
if os.path.exists(src):
|
2016-08-25 21:38:19 +05:30
|
|
|
sym_link = os.path.abspath(os.path.join(binDir,subDir if theFile == '' else theName))
|
|
|
|
|
|
|
|
if os.path.lexists(sym_link):
|
|
|
|
os.remove(sym_link)
|
|
|
|
output = theName+damask.util.deemph(theExt)
|
|
|
|
else:
|
|
|
|
output = damask.util.emph(theName)+damask.util.deemph(theExt)
|
|
|
|
|
|
|
|
sys.stdout.write(damask.util.deemph('... ')+output+'\n')
|
2014-01-11 18:16:30 +05:30
|
|
|
os.symlink(src,sym_link)
|
|
|
|
|
|
|
|
|
2016-08-25 21:38:19 +05:30
|
|
|
sys.stdout.write('\nMSC.Marc versioning...\n\n')
|
|
|
|
theMaster = 'DAMASK_marc.f90'
|
|
|
|
|
2014-01-11 18:16:30 +05:30
|
|
|
for version in MarcReleases:
|
2016-08-25 21:38:19 +05:30
|
|
|
src = os.path.abspath(os.path.join(baseDir,theMaster))
|
2014-01-11 18:16:30 +05:30
|
|
|
if os.path.exists(src):
|
2016-08-25 21:38:19 +05:30
|
|
|
sym_link = os.path.abspath(os.path.join(baseDir,'DAMASK_marc{}.f90'.format(version)))
|
2016-07-14 18:39:25 +05:30
|
|
|
if os.path.lexists(sym_link):
|
|
|
|
os.remove(sym_link)
|
2016-08-25 21:38:19 +05:30
|
|
|
output = version
|
2016-07-14 18:39:25 +05:30
|
|
|
else:
|
2016-08-25 21:38:19 +05:30
|
|
|
output = damask.util.emph(version)
|
2016-07-14 18:39:25 +05:30
|
|
|
|
2016-08-25 21:38:19 +05:30
|
|
|
sys.stdout.write(' '+output+'\n')
|
|
|
|
os.symlink(theMaster,sym_link)
|