--- ray/build_utils/install.py 2016/04/19 21:21:23 1.5 +++ ray/build_utils/install.py 2018/01/08 13:38:37 1.6 @@ -1,27 +1,32 @@ +from __future__ import division, print_function, unicode_literals import os +import stat -def install_dir(env, il, sbase, tbase, dir): - fulldir = os.path.join(sbase, dir) +def install_dir(env, instlist, sbase, tbase, subdir): + fulldir = os.path.join(sbase, subdir) l = os.listdir(fulldir) - instdir = os.path.join(tbase, dir) + instdir = os.path.join(tbase, subdir) for item in l: - if item[0] == '.' or item[-1] in '%~' or item == 'CVS': + if (item[0] == '.' + or item[-1] in '%~' + or item == 'CVS' + or item.lower().startswith('cmake')): continue elif os.path.isdir(os.path.join(fulldir, item)): - install_dir(env, il, sbase, tbase, os.path.join(dir, item)) + install_dir(env, instlist, sbase, tbase, os.path.join(subdir, item)) else: inst = env.Install(instdir, os.path.join(fulldir, item)) - il.append(inst) + instlist.append(inst) def install_rlibfiles(env): buildrlib = env['RAD_BUILDRLIB'] if buildrlib[0] == '#': buildrlib = buildrlib[1:] sbase = os.path.join(os.getcwd(), buildrlib) - il = [] - install_dir(env, il, sbase, env['RAD_RLIBDIR'], '') - env.Append(RAD_RLIBINSTALL=il) + instlist = [] + install_dir(env, instlist, sbase, env['RAD_RLIBDIR'], '') + env.Append(RAD_RLIBINSTALL=instlist) def install_manfiles(env): @@ -35,15 +40,20 @@ def install_manfiles(env): def install_script(target, source, env): - for t,s in map(None,target,source): + #for t,s in map(None,target,source): + for t,s in zip(target, source): sf = open(str(s), 'r') tf = open(str(t), 'w') tf.write(sf.read()) - os.chmod(str(t), 00755) + os.chmod(str(t), + stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | + stat.S_IRGRP | stat.S_IWGRP | + stat.S_IROTH | stat.S_IWOTH) def install_tclscript(target, source, env): # XXX posix only for the moment - for t,s in map(None, target,source): + #for t,s in map(None, target,source): + for t,s in zip(target, source): bindir = os.path.split(t.get_abspath())[0] instdir = os.path.split(bindir)[0] tcllibdir = os.path.join(instdir, 'lib', 'tcl') @@ -58,7 +68,10 @@ def install_tclscript(target, source, env): # XXX this should really be handled by an envvar. line = 'set radlib %s\n' % tcllibdir tf.write(line) - os.chmod(str(t), 00755) + os.chmod(str(t), + stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR | + stat.S_IRGRP | stat.S_IWGRP | + stat.S_IROTH | stat.S_IWOTH) def build_with_pyinstaller(targets, sources, env): workpath = env.Dir('$RAD_BUILDOBJ', 'pybuild') # --workpath @ @@ -66,3 +79,5 @@ def build_with_pyinstaller(targets, sources, env): # -F # one-file # --noconsole pass + +# vi: set ts=4 sw=4 :