502d099cc65cffd8a52e5f9c92d446e59122be6f
[packages/trusty/cirros-testvm.git] / cirros-testvm / src-cirros / buildroot-2015.05 / package / python-setuptools / 0001-add-executable.patch
1 Add a new --executable option to distribute so that we can
2 force the shebang line in installed python scripts.
3
4 [Thomas: refresh for setuptools 5.8.]
5
6 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
7 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8
9 Index: b/setuptools/command/install.py
10 ===================================================================
11 --- a/setuptools/command/install.py
12 +++ b/setuptools/command/install.py
13 @@ -16,6 +16,7 @@
14      """Use easy_install to install the package, w/dependencies"""
15  
16      user_options = orig.install.user_options + [
17 +        ('executable=', 'e', "specify final destination interpreter path"),
18          ('old-and-unmanageable', None, "Try not to use this!"),
19          ('single-version-externally-managed', None,
20           "used by system package builders to create 'flat' eggs"),
21 @@ -31,6 +32,7 @@
22  
23      def initialize_options(self):
24          orig.install.initialize_options(self)
25 +        self.executable = None
26          self.old_and_unmanageable = None
27          self.single_version_externally_managed = None
28  
29 Index: b/setuptools/command/install_scripts.py
30 ===================================================================
31 --- a/setuptools/command/install_scripts.py
32 +++ b/setuptools/command/install_scripts.py
33 @@ -11,6 +11,13 @@
34      def initialize_options(self):
35          orig.install_scripts.initialize_options(self)
36          self.no_ep = False
37 +        self.executable = None
38 +
39 +    def finalize_options(self):
40 +        orig.install_scripts.finalize_options(self)
41 +        self.set_undefined_options('install',
42 +                ('executable','executable')
43 +        )
44  
45      def run(self):
46          from setuptools.command.easy_install import get_script_args
47 @@ -32,6 +39,8 @@
48          )
49          bs_cmd = self.get_finalized_command('build_scripts')
50          executable = getattr(bs_cmd, 'executable', sys_executable)
51 +        if self.executable is not None:
52 +            executable = self.executable
53          is_wininst = getattr(
54              self.get_finalized_command("bdist_wininst"), '_is_running', False
55          )