summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-installer/interpreter.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3-installer/interpreter.patch')
-rw-r--r--meta/recipes-devtools/python/python3-installer/interpreter.patch24
1 files changed, 17 insertions, 7 deletions
diff --git a/meta/recipes-devtools/python/python3-installer/interpreter.patch b/meta/recipes-devtools/python/python3-installer/interpreter.patch
index ef10ef1b45..7906769b90 100644
--- a/meta/recipes-devtools/python/python3-installer/interpreter.patch
+++ b/meta/recipes-devtools/python/python3-installer/interpreter.patch
@@ -1,3 +1,8 @@
1From 74fe171fa4a25c120607e9f8450cbdfee675c959 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Mon, 14 Mar 2022 14:39:22 +0000
4Subject: [PATCH] python3-installer: add installer module
5
1Let us override the hashbang directly (possibly upstreamable), and don't 6Let us override the hashbang directly (possibly upstreamable), and don't
2play games with hashbangs: for now assume that even hashbangs with spaces 7play games with hashbangs: for now assume that even hashbangs with spaces
3are simple (assume the spaces are only used to separate arguments) and 8are simple (assume the spaces are only used to separate arguments) and
@@ -6,13 +11,18 @@ we don't have long hashbangs.
6Upstream-Status: Inappropriate 11Upstream-Status: Inappropriate
7Signed-off-by: Ross Burton <ross.burton@arm.com> 12Signed-off-by: Ross Burton <ross.burton@arm.com>
8 13
14---
15 src/installer/__main__.py | 9 ++++++++-
16 src/installer/scripts.py | 15 +--------------
17 2 files changed, 9 insertions(+), 15 deletions(-)
18
9diff --git a/src/installer/__main__.py b/src/installer/__main__.py 19diff --git a/src/installer/__main__.py b/src/installer/__main__.py
10index 3357ec5..d2fd8d2 100644 20index 51014b9..38de286 100644
11--- a/src/installer/__main__.py 21--- a/src/installer/__main__.py
12+++ b/src/installer/__main__.py 22+++ b/src/installer/__main__.py
13@@ -23,6 +23,13 @@ def _get_main_parser() -> argparse.ArgumentParser: 23@@ -30,6 +30,13 @@ def _get_main_parser() -> argparse.ArgumentParser:
14 type=str, 24 type=str,
15 help="destination directory (prefix to prepend to each file)", 25 help="override prefix to install packages to",
16 ) 26 )
17+ parser.add_argument( 27+ parser.add_argument(
18+ "--interpreter", 28+ "--interpreter",
@@ -24,10 +34,10 @@ index 3357ec5..d2fd8d2 100644
24 parser.add_argument( 34 parser.add_argument(
25 "--compile-bytecode", 35 "--compile-bytecode",
26 action="append", 36 action="append",
27@@ -73,7 +80,7 @@ def _main(cli_args: Sequence[str], program: Optional[str] = None) -> None: 37@@ -86,7 +93,7 @@ def _main(cli_args: Sequence[str], program: Optional[str] = None) -> None:
28 with WheelFile.open(args.wheel) as source: 38 with WheelFile.open(args.wheel) as source:
29 destination = SchemeDictionaryDestination( 39 destination = SchemeDictionaryDestination(
30 scheme_dict=_get_scheme_dict(source.distribution), 40 scheme_dict=_get_scheme_dict(source.distribution, prefix=args.prefix),
31- interpreter=sys.executable, 41- interpreter=sys.executable,
32+ interpreter=args.interpreter, 42+ interpreter=args.interpreter,
33 script_kind=get_launcher_kind(), 43 script_kind=get_launcher_kind(),
@@ -56,6 +66,6 @@ index 7e3c8fc..ba6ed5a 100644
56- # I don't understand a lick what this is trying to do. 66- # I don't understand a lick what this is trying to do.
57- return b"#!/bin/sh\n'''exec' " + quoted + b' "$0" "$@"\n' + b"' '''" 67- return b"#!/bin/sh\n'''exec' " + quoted + b' "$0" "$@"\n' + b"' '''"
58+ return b"#!" + executable_bytes 68+ return b"#!" + executable_bytes
59 69
60 70
61 class InvalidScript(ValueError): 71 class InvalidScript(ValueError):