Commit 7f15ec5c authored by Just van Rossum's avatar Just van Rossum

use the same Python for running the bootstrap script and the main program

parent ee2db3eb
...@@ -266,7 +266,7 @@ STRIP_EXEC = "/usr/bin/strip" ...@@ -266,7 +266,7 @@ STRIP_EXEC = "/usr/bin/strip"
# sys.executable later. # sys.executable later.
# #
BOOTSTRAP_SCRIPT = """\ BOOTSTRAP_SCRIPT = """\
#!/usr/bin/env python #!%(hashbang)s
import sys, os import sys, os
execdir = os.path.dirname(sys.argv[0]) execdir = os.path.dirname(sys.argv[0])
...@@ -423,6 +423,14 @@ class AppBuilder(BundleBuilder): ...@@ -423,6 +423,14 @@ class AppBuilder(BundleBuilder):
execdir = pathjoin(self.bundlepath, self.execdir) execdir = pathjoin(self.bundlepath, self.execdir)
bootstrappath = pathjoin(execdir, self.name) bootstrappath = pathjoin(execdir, self.name)
makedirs(execdir) makedirs(execdir)
if self.standalone:
# XXX we're screwed when the end user has deleted
# /usr/bin/python
hashbang = "/usr/bin/python"
else:
hashbang = sys.executable
while os.path.islink(hashbang):
hashbang = os.readlink(hashbang)
open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals()) open(bootstrappath, "w").write(BOOTSTRAP_SCRIPT % locals())
os.chmod(bootstrappath, 0775) os.chmod(bootstrappath, 0775)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment