summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucian Petrut <lpetrut@cloudbasesolutions.com>2015-01-28 03:17:18 +0200
committerLucian Petrut <lpetrut@cloudbasesolutions.com>2015-01-28 03:44:50 +0200
commitf95d7d7bb975b1862ee0e0f403d9763217fdb912 (patch)
tree96404caadb38adcab6809855efb319103912ff22
parent0a92e4d0dc4c69db0f758e9e557a4318314240d2 (diff)
downloadpbr-f95d7d7bb975b1862ee0e0f403d9763217fdb912.tar.gz
Fixes Windows generated scripts headers
When installing packages on Windows, generated scripts based on entry points have wrong Python executable paths in the header. For this reason, generated executables fail with 'fail to create proccess'. For example, if the Python executable path is 'C:\Program Files\Python27\python.exe', the scripts will contain '#!C:ProgramFilesPython27python.exe' A simple fix is to wrap the Python executable in brackets on Windows. Change-Id: Id017073c58c162c3e0c546b1ab76a7bea9a9f04e Closes-Bug: #1416342
-rw-r--r--pbr/packaging.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/pbr/packaging.py b/pbr/packaging.py
index c42600e..db4afd8 100644
--- a/pbr/packaging.py
+++ b/pbr/packaging.py
@@ -344,11 +344,6 @@ class LocalInstallScripts(install_scripts.install_scripts):
command_name = 'install_scripts'
def run(self):
- if os.name != 'nt':
- get_script_args = override_get_script_args
- else:
- get_script_args = easy_install.get_script_args
-
import distutils.command.install_scripts
self.run_command("egg_info")
@@ -373,6 +368,13 @@ class LocalInstallScripts(install_scripts.install_scripts):
is_wininst = getattr(
self.get_finalized_command("bdist_wininst"), '_is_running', False
)
+
+ if os.name != 'nt':
+ get_script_args = override_get_script_args
+ else:
+ get_script_args = easy_install.get_script_args
+ executable = '"%s"' % executable
+
for args in get_script_args(dist, executable, is_wininst):
self.write_script(*args)