Commit bb7efd39 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

Merge branch 'master' into 'master'

change the method for LHCbDirac

See merge request !53
parents 15267618 ec2a5921
......@@ -478,7 +478,6 @@ def lhcbdirac(proj, url=None, export=False):
Special hybrid checkout needed to release LHCbDirac.
from os.path import join, isdir, basename
log = __log__.getChild('lhcbdirac')
if proj.version.lower() == 'head':
......@@ -486,44 +485,19 @@ def lhcbdirac(proj, url=None, export=False):
commit = proj.version
prjroot = proj.baseDir
output = git(proj, url, commit, export)
outputs = []
outputs.append( git( proj, url, commit, export ) )
log.debug('creating version.cmt files')
for root, dirs, files in os.walk(prjroot):
if basename(root) == 'cmt':
dirs[:] = [] # stop recursion
if 'version.cmt' not in files:
log.debug(' writing %s/version.cmt', root)
with open(join(root, 'version.cmt'), 'w') as f:
log.debug('starting post-checkout step for %s', proj)
log.debug('deploying scripts')
scripts_dir = join(prjroot, 'scripts')
if not isdir(scripts_dir):
for root, dirs, files in os.walk(join(prjroot, 'LHCbDIRAC')):
if 'scripts' in dirs:
log.debug(' - %s', root)
# we are only interested in the content of the scripts directories
dirs[:] = ['scripts']
elif basename(root) == 'scripts':
dirs[:] = [] # avoid further recursion (it should not be needed)
for f in files:
if f.endswith('.py'):
dst = join(scripts_dir, f[:-3])
dst = join(scripts_dir, f)
shutil.copyfile(join(root, f), dst)
os.chmod(dst, 0755) # ensure that the new file is executable
def call( *args, **kwargs ):
'helper to simplify the code'
outputs.append( log_call( *args, **kwargs ) )
log.debug('patching Makefile')
with open(join(prjroot, 'Makefile'), 'a') as f:
f.write('\nall:\n\t$(RM) InstallArea/python InstallArea/scripts\n')
dest = proj.baseDir
log.debug( 'fixing requirements files' )
call( ['make', 'clean'], cwd = dest )
call( ['make', 'all'], cwd = dest )
return output
return _merge_outputs( outputs )
def lhcbgrid(proj, url=None, export=False, merge=None):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment