diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-08-25 11:37:43 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-08-25 11:37:43 (GMT) |
commit | 9f5c0c41ce000e57f9d196f398dcc7a4142ab3ce (patch) | |
tree | 6b773a71ec5aac9355560fe7383a393c8280f650 /Lib/distutils/command | |
parent | be83737c7cd98df576239d4a8f86024ee3b2845c (diff) | |
download | cpython-9f5c0c41ce000e57f9d196f398dcc7a4142ab3ce.zip cpython-9f5c0c41ce000e57f9d196f398dcc7a4142ab3ce.tar.gz cpython-9f5c0c41ce000e57f9d196f398dcc7a4142ab3ce.tar.bz2 |
Patch #736857, #736859: Add -e option to build_scripts.
Diffstat (limited to 'Lib/distutils/command')
-rw-r--r-- | Lib/distutils/command/build.py | 5 | ||||
-rw-r--r-- | Lib/distutils/command/build_scripts.py | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/Lib/distutils/command/build.py b/Lib/distutils/command/build.py index 7823154..e6b3991 100644 --- a/Lib/distutils/command/build.py +++ b/Lib/distutils/command/build.py @@ -40,6 +40,8 @@ class build (Command): "compile extensions and libraries with debugging information"), ('force', 'f', "forcibly build everything (ignore file timestamps)"), + ('executable=', 'e', + "specify final destination interpreter path (build.py)"), ] boolean_options = ['debug', 'force'] @@ -61,6 +63,7 @@ class build (Command): self.compiler = None self.debug = None self.force = 0 + self.executable = None def finalize_options (self): @@ -93,6 +96,8 @@ class build (Command): self.build_scripts = os.path.join(self.build_base, 'scripts-' + sys.version[0:3]) + if self.executable is None: + self.executable = os.path.normpath(sys.executable) # finalize_options () diff --git a/Lib/distutils/command/build_scripts.py b/Lib/distutils/command/build_scripts.py index e0fcc23..fb73719 100644 --- a/Lib/distutils/command/build_scripts.py +++ b/Lib/distutils/command/build_scripts.py @@ -24,6 +24,7 @@ class build_scripts (Command): user_options = [ ('build-dir=', 'd', "directory to \"build\" (copy) to"), ('force', 'f', "forcibly build everything (ignore file timestamps"), + ('executable=', 'e', "specify final destination interpreter path"), ] boolean_options = ['force'] @@ -33,12 +34,14 @@ class build_scripts (Command): self.build_dir = None self.scripts = None self.force = None + self.executable = None self.outfiles = None def finalize_options (self): self.set_undefined_options('build', ('build_scripts', 'build_dir'), - ('force', 'force')) + ('force', 'force'), + ('executable', 'executable')) self.scripts = self.distribution.scripts def get_source_files(self): @@ -95,7 +98,7 @@ class build_scripts (Command): outf = open(outfile, "w") if not sysconfig.python_build: outf.write("#!%s%s\n" % - (os.path.normpath(sys.executable), + (self.executable, post_interp)) else: outf.write("#!%s%s\n" % |