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
|
|
|
|
|
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('\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)
|