From 59d2b25087fb0eaa1a8d86b226055d17e8401b09 Mon Sep 17 00:00:00 2001 From: oreo639 Date: Mon, 31 Mar 2025 13:52:43 -0700 Subject: [PATCH] hooks/pre-pkg/03-rewrite-python-shebang.sh: rewrite plain python shebang Shebangs containing #!python are ignored currently, which causes a problem since newer versions of python3-setuptools generate this, so replace them with the proper shebang when encountered. https://github.com/pypa/setuptools/issues/4863 --- common/hooks/pre-pkg/03-rewrite-python-shebang.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh index 47c7a996a50..0071c9e132e 100644 --- a/common/hooks/pre-pkg/03-rewrite-python-shebang.sh +++ b/common/hooks/pre-pkg/03-rewrite-python-shebang.sh @@ -24,7 +24,7 @@ hook() { while IFS= read -r -d '' file; do [ ! -s "$file" ] && continue - pyinterp=$(sed -n -E -e 2q -e 's@^#!.*([[:space:]]|/)(python([0-9](\.[0-9]+)?)?)([[:space:]]+.*|$)@\2@p' "$file") + pyinterp=$(sed -n -E -e 2q -e 's@^#!(.*([[:space:]]|/))?(python([0-9](\.[0-9]+)?)?)([[:space:]]+.*|$)@\3@p' "$file") [ -z "$pyinterp" ] && continue pyver=${pyinterp#python}