--- ray/build_utils/install.py 2004/10/21 15:47:12 1.2 +++ ray/build_utils/install.py 2016/03/05 13:24:58 1.4 @@ -34,10 +34,28 @@ def install_manfiles(env): env.Append(RAD_MANINSTALL=il) -def install_cshscript(target, source, env): +def install_script(target, source, env): for t,s in map(None,target,source): sf = open(str(s), 'r') tf = open(str(t), 'w') 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)