python-setuptools-add-executable.patch 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Add a new --executable option to distribute so that we can
  2. force the shebang line in installed python scripts.
  3. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  4. diff -Nura distribute-0.6.36.orig/setuptools/command/install.py distribute-0.6.36/setuptools/command/install.py
  5. --- distribute-0.6.36.orig/setuptools/command/install.py 2013-04-13 09:46:23.160823598 -0300
  6. +++ distribute-0.6.36/setuptools/command/install.py 2013-04-13 11:17:28.418841986 -0300
  7. @@ -6,6 +6,7 @@
  8. """Use easy_install to install the package, w/dependencies"""
  9. user_options = _install.user_options + [
  10. + ('executable=', 'e', "specify final destination interpreter path"),
  11. ('old-and-unmanageable', None, "Try not to use this!"),
  12. ('single-version-externally-managed', None,
  13. "used by system package builders to create 'flat' eggs"),
  14. @@ -21,6 +22,7 @@
  15. def initialize_options(self):
  16. _install.initialize_options(self)
  17. + self.executable = None
  18. self.old_and_unmanageable = None
  19. self.single_version_externally_managed = None
  20. self.no_compile = None # make DISTUTILS_DEBUG work right!
  21. diff -Nura distribute-0.6.36.orig/setuptools/command/install_scripts.py distribute-0.6.36/setuptools/command/install_scripts.py
  22. --- distribute-0.6.36.orig/setuptools/command/install_scripts.py 2013-04-13 09:46:23.160823598 -0300
  23. +++ distribute-0.6.36/setuptools/command/install_scripts.py 2013-04-13 11:24:32.305416400 -0300
  24. @@ -10,6 +10,13 @@
  25. def initialize_options(self):
  26. _install_scripts.initialize_options(self)
  27. self.no_ep = False
  28. + self.executable = None
  29. +
  30. + def finalize_options(self):
  31. + _install_scripts.finalize_options(self)
  32. + self.set_undefined_options('install',
  33. + ('executable','executable')
  34. + )
  35. def run(self):
  36. from setuptools.command.easy_install import get_script_args
  37. @@ -31,6 +38,8 @@
  38. )
  39. bs_cmd = self.get_finalized_command('build_scripts')
  40. executable = getattr(bs_cmd,'executable',sys_executable)
  41. + if self.executable is not None:
  42. + executable = self.executable
  43. is_wininst = getattr(
  44. self.get_finalized_command("bdist_wininst"), '_is_running', False
  45. )