1 diff -ruN Python-2.5.4.orig/Lib/distutils/command/build_scripts.py Python-2.5.4/Lib/distutils/command/build_scripts.py
2 --- Python-2.5.4.orig/Lib/distutils/command/build_scripts.py 2009-01-11 06:17:43.000000000 +0100
3 +++ Python-2.5.4/Lib/distutils/command/build_scripts.py 2009-01-11 15:01:54.000000000 +0100
7 def copy_scripts (self):
8 - """Copy each script listed in 'self.scripts'; if it's marked as a
9 - Python script in the Unix way (first line matches 'first_line_re',
10 - ie. starts with "\#!" and contains "python"), then adjust the first
11 - line to refer to the current Python interpreter as we copy.
13 + """Copy each script listed in 'self.scripts'"""
14 self.mkpath(self.build_dir)
16 for script in self.scripts:
18 script = convert_path(script)
19 outfile = os.path.join(self.build_dir, os.path.basename(script))
20 outfiles.append(outfile)
22 self.warn("%s is an empty file (skipping)" % script)
25 - match = first_line_re.match(first_line)
28 - post_interp = match.group(1) or ''
31 - log.info("copying and adjusting %s -> %s", script,
33 - if not self.dry_run:
34 - outf = open(outfile, "w")
35 - if not sysconfig.python_build:
36 - outf.write("#!%s%s\n" %
40 - outf.write("#!%s%s\n" %
42 - sysconfig.get_config_var("BINDIR"),
43 - "python" + sysconfig.get_config_var("EXE")),
45 - outf.writelines(f.readlines())
52 - self.copy_file(script, outfile)
56 + log.info("copying %s -> %s", script,
58 + self.copy_file(script, outfile)
60 if os.name == 'posix':