mirror of
https://git.yoctoproject.org/poky
synced 2026-02-05 16:28:43 +01:00
python: Avoid shebang overflow on python-config.py
The native path may be too big, leading to shebang overflow. Just use the #!/usr/bin/env python3. (From OE-Core rev: 8a86bd88f0b46b0f413b98df20891cb9aa84c271) Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 84783dee09e48cb930c7cd27944eaf3f03997237) Signed-off-by: Steve Sakoman <steve@sakoman.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
daa47a6171
commit
141de70a39
@@ -0,0 +1,33 @@
|
||||
From f0c9dec63d452a7cd1e15ea653f4aced281f021c Mon Sep 17 00:00:00 2001
|
||||
From: Paulo Neves <ptsneves@gmail.com>
|
||||
Date: Tue, 7 Jun 2022 16:16:41 +0200
|
||||
Subject: [PATCH 1/1] Avoid shebang overflow on python-config.py
|
||||
|
||||
The whole native path may be too big, leading to shebang
|
||||
overflow. Let's just use the env shebang.
|
||||
|
||||
Denial reason: [1]
|
||||
|
||||
Upstream-Status: Denied [distribution]
|
||||
|
||||
[1] https://github.com/python/cpython/pull/93760#pullrequestreview-1005365737
|
||||
---
|
||||
Makefile.pre.in | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/Makefile.pre.in b/Makefile.pre.in
|
||||
index f0aedb76cb58999427804255da56fa53284d7032..dd88e43114730f7681715777cc76dabb31113176 100644
|
||||
--- a/Makefile.pre.in
|
||||
+++ b/Makefile.pre.in
|
||||
@@ -1638,6 +1638,8 @@ python-config: $(srcdir)/Misc/python-config.in Misc/python-config.sh
|
||||
@ # Substitution happens here, as the completely-expanded BINDIR
|
||||
@ # is not available in configure
|
||||
sed -e "s,@EXENAME@,$(BINDIR)/python$(LDVERSION)$(EXE)," < $(srcdir)/Misc/python-config.in >python-config.py
|
||||
+ @ # Otherwise we might get huge shebangs with native paths
|
||||
+ sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' python-config.py
|
||||
@ # Replace makefile compat. variable references with shell script compat. ones; $(VAR) -> ${VAR}
|
||||
LC_ALL=C sed -e 's,\$$(\([A-Za-z0-9_]*\)),\$$\{\1\},g' < Misc/python-config.sh >python-config
|
||||
@ # In OpenEmbedded, always use the python version of the script, the shell
|
||||
--
|
||||
2.25.1
|
||||
|
||||
Reference in New Issue
Block a user