--- ray/build_utils/install.py 2016/03/05 00:40:25 1.3 +++ ray/build_utils/install.py 2016/03/05 13:24:58 1.4 @@ -41,3 +41,21 @@ def install_script(target, source, env): tf.write(sf.read()) os.chmod(str(t), 00755) +def install_tclscript(target, source, env): + # XXX posix only for the moment + for t,s in map(None, target,source): + bindir = os.path.split(t.get_abspath())[0] + instdir = os.path.split(bindir)[0] + tcllibdir = os.path.join(instdir, 'lib', 'tcl') + sf = open(str(s), 'r') + tf = open(str(t), 'w') + # as recommended in the wish manpage + tf.write('''#!/bin/sh\n''') + for line in sf.readlines(): + if line.startswith('#!'): + tf.write('### ' + line) + if line.startswith('set radlib'): + # XXX this should really be handled by an envvar. + line = 'set radlib %s\n' % tcllibdir + tf.write(line) + os.chmod(str(t), 00755)