Revert "Remove win32/nt checks for wrapper script gen"

This reverts commit 07de844615.
The output console_scripts generated after this commit landed are no
longer directly callable from windows machines. Prior to the this
reverts we wrapped console_script entrypoints in a .exe on windows so
you could directly execute them, just like on *nix systems. However,
after the commit we are no longer generating callables on windows.
Instead PBR generates a txt file, without a suffix, that is not a valid
executable on windows. It is exactly the same output as on a *nix
system, but this neglects that scripts with shebangs don't work on
windows. (For example generated output on windows see [1]) The exe files
were needed so that we could directly execute the console scripts on
windows. This commit restores this functionality so that PBR will
properly generate executable console_scripts on windows machines again.

Closes-Bug: #1761134
[1] http://paste.openstack.org/show/722389/

Change-Id: Ifc13879b7f64650d444e3a14df1a53b2172828e4
This commit is contained in:
Matthew Treinish 2018-05-31 10:59:25 -04:00
parent f30aa7a97f
commit ee26945cb3
No known key found for this signature in database
GPG Key ID: FD12A0F214C9E177
1 changed files with 9 additions and 1 deletions

View File

@ -409,6 +409,8 @@ class LocalDevelop(develop.develop):
command_name = 'develop'
def install_wrapper_scripts(self, dist):
if sys.platform == 'win32':
return develop.develop.install_wrapper_scripts(self, dist)
if not self.exclude_scripts:
for args in override_get_script_args(dist):
self.write_script(*args)
@ -462,7 +464,13 @@ class LocalInstallScripts(install_scripts.install_scripts):
# entry-points listed for this package.
return
for args in override_get_script_args(dist, executable, is_wininst):
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)