0001-add-executable.patch 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. From 9b3d307f8f6a1af88f3f810f5a6cf0835830e1e8 Mon Sep 17 00:00:00 2001
  2. From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
  3. Date: Mon, 7 Dec 2015 01:14:33 +0100
  4. Subject: [PATCH 1/1] add executable
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. Add a new --executable option to distribute so that we can
  9. force the shebang line in installed python scripts.
  10. [Thomas: refresh for setuptools 5.8.]
  11. [Jörg: refresh for setuptools 18.7.1]
  12. Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
  13. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
  14. Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
  15. ---
  16. setuptools/command/install.py | 2 ++
  17. setuptools/command/install_scripts.py | 9 +++++++++
  18. 2 files changed, 11 insertions(+)
  19. diff --git a/setuptools/command/install.py b/setuptools/command/install.py
  20. index d2bca2e..b60ef19 100644
  21. --- a/setuptools/command/install.py
  22. +++ b/setuptools/command/install.py
  23. @@ -16,6 +16,7 @@ class install(orig.install):
  24. """Use easy_install to install the package, w/dependencies"""
  25. user_options = orig.install.user_options + [
  26. + ('executable=', 'e', "specify final destination interpreter path"),
  27. ('old-and-unmanageable', None, "Try not to use this!"),
  28. ('single-version-externally-managed', None,
  29. "used by system package builders to create 'flat' eggs"),
  30. @@ -31,6 +32,7 @@ class install(orig.install):
  31. def initialize_options(self):
  32. orig.install.initialize_options(self)
  33. + self.executable = None
  34. self.old_and_unmanageable = None
  35. self.single_version_externally_managed = None
  36. diff --git a/setuptools/command/install_scripts.py b/setuptools/command/install_scripts.py
  37. index be66cb2..07afaf8 100755
  38. --- a/setuptools/command/install_scripts.py
  39. +++ b/setuptools/command/install_scripts.py
  40. @@ -11,6 +11,13 @@ class install_scripts(orig.install_scripts):
  41. def initialize_options(self):
  42. orig.install_scripts.initialize_options(self)
  43. self.no_ep = False
  44. + self.executable = None
  45. +
  46. + def finalize_options(self):
  47. + orig.install_scripts.finalize_options(self)
  48. + self.set_undefined_options('install',
  49. + ('executable','executable')
  50. + )
  51. def run(self):
  52. import setuptools.command.easy_install as ei
  53. @@ -31,6 +38,8 @@ class install_scripts(orig.install_scripts):
  54. )
  55. bs_cmd = self.get_finalized_command('build_scripts')
  56. exec_param = getattr(bs_cmd, 'executable', None)
  57. + if self.executable is not None:
  58. + exec_param = self.executable
  59. bw_cmd = self.get_finalized_command("bdist_wininst")
  60. is_wininst = getattr(bw_cmd, '_is_running', False)
  61. writer = ei.ScriptWriter
  62. --
  63. 2.6.3