summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eclass/distutils-r1.eclass9
-rw-r--r--eclass/python-utils-r1.eclass134
-rwxr-xr-xeclass/tests/python-utils-r1.sh86
-rw-r--r--sys-kernel/vanilla-sources/Manifest2
-rw-r--r--sys-kernel/vanilla-sources/vanilla-sources-4.14.275.ebuild (renamed from sys-kernel/vanilla-sources/vanilla-sources-4.14.274.ebuild)0
-rw-r--r--sys-libs/compiler-rt-sanitizers/Manifest2
-rw-r--r--sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.ebuild2
7 files changed, 117 insertions, 118 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index ed2e9f70269f..0491452104be 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -1015,8 +1015,15 @@ distutils_pep517_install() {
einfo " Building the wheel for ${PWD#${WORKDIR}/} via ${build_backend}"
local wheel=$(
"${EPYTHON}" - 3>&1 >&2 <<-EOF || die "Wheel build failed"
- import ${build_backend%:*}
import os
+ import sys
+ import tomli
+
+ sys.path[:0] = (tomli.load(open("pyproject.toml", "rb"))
+ .get("build-system", {})
+ .get("backend-path", []))
+
+ import ${build_backend%:*}
print(${build_backend/:/.}.build_wheel(os.environ['WHEEL_BUILD_DIR']),
file=os.fdopen(3, 'w'))
EOF
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 7b0c9aa280d8..98cb49c95fd7 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1001,25 +1001,30 @@ _python_wrapper_setup() {
# @FUNCTION: python_fix_shebang
# @USAGE: [-f|--force] [-q|--quiet] <path>...
# @DESCRIPTION:
-# Replace the shebang in Python scripts with the current Python
-# implementation (EPYTHON). If a directory is passed, works recursively
-# on all Python scripts.
+# Replace the shebang in Python scripts with the full path
+# to the current Python implementation (PYTHON, including EPREFIX).
+# If a directory is passed, works recursively on all Python scripts
+# found inside the directory tree.
#
-# Only files having a 'python*' shebang will be modified. Files with
-# other shebang will either be skipped when working recursively
-# on a directory or treated as error when specified explicitly.
+# Only files having a Python shebang (a path to any known Python
+# interpreter, optionally preceded by env(1) invocation) will
+# be processed. Files with any other shebang will either be skipped
+# silently when a directory was passed, or an error will be reported
+# for any files without Python shebangs specified explicitly.
#
-# Shebangs matching explicitly current Python version will be left
-# unmodified. Shebangs requesting another Python version will be treated
-# as fatal error, unless --force is given.
+# Shebangs that are compatible with the current Python version will be
+# mangled unconditionally. Incompatible shebangs will cause a fatal
+# error, unless --force is specified.
#
-# --force causes the function to replace even shebangs that require
-# incompatible Python version. --quiet causes the function not to list
-# modified files verbosely.
+# --force causes the function to replace shebangs with incompatible
+# Python version (but not non-Python shebangs). --quiet causes
+# the function not to list modified files verbosely.
python_fix_shebang() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${EPYTHON} ]] || die "${FUNCNAME}: EPYTHON unset (pkg_setup not called?)"
+ local PYTHON
+ _python_export "${EPYTHON}" PYTHON
local force quiet
while [[ ${@} ]]; do
@@ -1035,13 +1040,13 @@ python_fix_shebang() {
local path f
for path; do
- local any_correct any_fixed is_recursive
+ local any_fixed is_recursive
[[ -d ${path} ]] && is_recursive=1
while IFS= read -r -d '' f; do
local shebang i
- local error= from=
+ local error= match=
# note: we can't ||die here since read will fail if file
# has no newline characters
@@ -1050,64 +1055,36 @@ python_fix_shebang() {
# First, check if it's shebang at all...
if [[ ${shebang} == '#!'* ]]; then
local split_shebang=()
- read -r -a split_shebang <<<${shebang} || die
-
- # Match left-to-right in a loop, to avoid matching random
- # repetitions like 'python2.7 python2'.
- for i in "${split_shebang[@]}"; do
- case "${i}" in
- *"${EPYTHON}")
- debug-print "${FUNCNAME}: in file ${f#${D%/}}"
- debug-print "${FUNCNAME}: shebang matches EPYTHON: ${shebang}"
-
- # Nothing to do, move along.
- any_correct=1
- from=${EPYTHON}
- break
- ;;
- *python|*python[23])
- debug-print "${FUNCNAME}: in file ${f#${D%/}}"
- debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
-
- if [[ ${i} == *python2 ]]; then
- from=python2
- if [[ ! ${force} ]]; then
- error=1
- fi
- elif [[ ${i} == *python3 ]]; then
- from=python3
- else
- from=python
- fi
- break
- ;;
- *python[23].[0-9]|*python3.[1-9][0-9]|*pypy|*pypy3|*jython[23].[0-9])
- # Explicit mismatch.
- if [[ ! ${force} ]]; then
- error=1
- else
- case "${i}" in
- *python[23].[0-9])
- from="python[23].[0-9]";;
- *python3.[1-9][0-9])
- from="python3.[1-9][0-9]";;
- *pypy)
- from="pypy";;
- *pypy3)
- from="pypy3";;
- *jython[23].[0-9])
- from="jython[23].[0-9]";;
- *)
- die "${FUNCNAME}: internal error in 2nd pattern match";;
- esac
- fi
- break
- ;;
- esac
- done
+ read -r -a split_shebang <<<${shebang#"#!"} || die
+
+ local in_path=${split_shebang[0]}
+ local from='^#! *[^ ]*'
+ # if the first component is env(1), skip it
+ if [[ ${in_path} == */env ]]; then
+ in_path=${split_shebang[1]}
+ from+=' *[^ ]*'
+ fi
+
+ case ${in_path##*/} in
+ "${EPYTHON}")
+ match=1
+ ;;
+ python|python[23])
+ match=1
+ [[ ${in_path##*/} == python2 ]] && error=1
+ ;;
+ python[23].[0-9]|python3.[1-9][0-9]|pypy|pypy3|jython[23].[0-9])
+ # Explicit mismatch.
+ match=1
+ error=1
+ ;;
+ esac
fi
- if [[ ! ${error} && ! ${from} ]]; then
+ # disregard mismatches in force mode
+ [[ ${force} ]] && error=
+
+ if [[ ! ${match} ]]; then
# Non-Python shebang. Allowed in recursive mode,
# disallowed when specifying file explicitly.
[[ ${is_recursive} ]] && continue
@@ -1119,13 +1096,9 @@ python_fix_shebang() {
fi
if [[ ! ${error} ]]; then
- # We either want to match ${from} followed by space
- # or at end-of-string.
- if [[ ${shebang} == *${from}" "* ]]; then
- sed -i -e "1s:${from} :${EPYTHON} :" "${f}" || die
- else
- sed -i -e "1s:${from}$:${EPYTHON}:" "${f}" || die
- fi
+ debug-print "${FUNCNAME}: in file ${f#${D%/}}"
+ debug-print "${FUNCNAME}: rewriting shebang: ${shebang}"
+ sed -i -e "1s@${from}@#!${PYTHON}@" "${f}" || die
any_fixed=1
else
eerror "The file has incompatible shebang:"
@@ -1138,12 +1111,7 @@ python_fix_shebang() {
if [[ ! ${any_fixed} ]]; then
eerror "QA error: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
- if [[ ${any_correct} ]]; then
- eerror "All files have ${EPYTHON} shebang already."
- else
- eerror "There are no Python files in specified directory."
- fi
-
+ eerror "There are no Python files in specified directory."
die "${FUNCNAME} did not match any fixable files"
fi
done
diff --git a/eclass/tests/python-utils-r1.sh b/eclass/tests/python-utils-r1.sh
index 8c733b22294e..ef7687b8a9cf 100755
--- a/eclass/tests/python-utils-r1.sh
+++ b/eclass/tests/python-utils-r1.sh
@@ -41,7 +41,7 @@ test_fix_shebang() {
local expect=${3}
local args=( "${@:4}" )
- tbegin "python_fix_shebang${args[@]+ ${args[*]}} from ${from} to ${to} (exp: ${expect})"
+ tbegin "python_fix_shebang${args[@]+ ${args[*]}} from ${from@Q} to ${to@Q} (exp: ${expect@Q})"
echo "${from}" > "${tmpfile}"
output=$( EPYTHON=${to} python_fix_shebang "${args[@]}" -q "${tmpfile}" 2>&1 )
@@ -156,36 +156,60 @@ fi
test_var PYTHON_PKG_DEP pypy3 '*dev-python/pypy3*:0='
test_var PYTHON_SCRIPTDIR pypy3 /usr/lib/python-exec/pypy3
-# generic shebangs
-test_fix_shebang '#!/usr/bin/python' python3.6 '#!/usr/bin/python3.6'
-test_fix_shebang '#!/usr/bin/python' pypy3 '#!/usr/bin/pypy3'
-
-# python2/python3 matching
-test_fix_shebang '#!/usr/bin/python3' python3.6 '#!/usr/bin/python3.6'
-test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
-test_fix_shebang '#!/usr/bin/python2' python3.6 '#!/usr/bin/python3.6' --force
-
-# pythonX.Y matching (those mostly test the patterns)
-test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL
-test_fix_shebang '#!/usr/bin/python2.7' python3.2 '#!/usr/bin/python3.2' --force
-test_fix_shebang '#!/usr/bin/python3.2' python3.2 '#!/usr/bin/python3.2'
-
-# fancy path handling
-test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
- '#!/mnt/python2/usr/bin/python3.6'
-test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \
- '#!/mnt/python2/usr/bin/python3.8'
-test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \
- '#!/mnt/python2/usr/bin/env python3.8'
-test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \
- '#!/mnt/python2/usr/bin/python3.8 python3'
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL
-test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \
- '#!/mnt/python2/usr/bin/python3.8 python3' --force
-test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL
-
-# regression test for bug #522080
-test_fix_shebang '#!/usr/bin/python ' python3.8 '#!/usr/bin/python3.8 '
+for EPREFIX in '' /foo; do
+ einfo "with EPREFIX=${EPREFIX@Q}"
+ eindent
+ # generic shebangs
+ test_fix_shebang '#!/usr/bin/python' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6"
+ test_fix_shebang '#!/usr/bin/python' pypy3 \
+ "#!${EPREFIX}/usr/bin/pypy3"
+
+ # python2/python3 matching
+ test_fix_shebang '#!/usr/bin/python3' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6"
+ test_fix_shebang '#!/usr/bin/python2' python3.6 FAIL
+ test_fix_shebang '#!/usr/bin/python2' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6" --force
+
+ # pythonX.Y matching (those mostly test the patterns)
+ test_fix_shebang '#!/usr/bin/python2.7' python3.2 FAIL
+ test_fix_shebang '#!/usr/bin/python2.7' python3.2 \
+ "#!${EPREFIX}/usr/bin/python3.2" --force
+ test_fix_shebang '#!/usr/bin/python3.2' python3.2 \
+ "#!${EPREFIX}/usr/bin/python3.2"
+
+ # fancy path handling
+ test_fix_shebang '#!/mnt/python2/usr/bin/python' python3.6 \
+ "#!${EPREFIX}/usr/bin/python3.6"
+ test_fix_shebang '#!/mnt/python2/usr/bin/python3' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#!/mnt/python2/usr/bin/env python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#!/mnt/python2/usr/bin/python3 python3' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 python3"
+ test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 FAIL
+ test_fix_shebang '#!/mnt/python2/usr/bin/python2 python3' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 python3" --force
+ test_fix_shebang '#!/usr/bin/foo' python3.8 FAIL
+
+ # regression test for bug #522080
+ test_fix_shebang '#!/usr/bin/python ' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 "
+
+ # test random whitespace in shebang
+ test_fix_shebang '#! /usr/bin/python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#! /usr/bin/python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+ test_fix_shebang '#! /usr/bin/env python' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8"
+
+ # test preserving options
+ test_fix_shebang '#! /usr/bin/python -b' python3.8 \
+ "#!${EPREFIX}/usr/bin/python3.8 -b"
+ eoutdent
+done
# check _python_impl_matches behavior
test_is "_python_impl_matches python3_6 -3" 0
diff --git a/sys-kernel/vanilla-sources/Manifest b/sys-kernel/vanilla-sources/Manifest
index 0a3e61cbc3ba..5eb83f6aa5a7 100644
--- a/sys-kernel/vanilla-sources/Manifest
+++ b/sys-kernel/vanilla-sources/Manifest
@@ -6,7 +6,7 @@ DIST linux-5.15.tar.xz 121913744 BLAKE2B 3921274b23f7938abdf3ed9334534b4581e13d7
DIST linux-5.16.tar.xz 123114100 BLAKE2B 07a90cc640ff89e1359c06cee8c38abd33e51f9b9a89833e31a1d2750526fda4a59e8884db3c1ea63df0a37f0d3de6b5a922b014b7313d8abce20d90ac08adcb SHA512 7a257dd576bc8493595ec7d6f3c9cb6e22c772a8b2dbe735d2485c4f5c56e26a08695546e7e0f1f1cd04a533f25e829361958d4da0b98bf0ba8094dd57a85aaf
DIST linux-5.17.tar.xz 128399340 BLAKE2B 82dc4a45cc25c781ac67aa6ed1e4c369544154960f41c4634d47621f381159687a227054976d078524cda28884d395a15f7542fe44ca74ce98ca6ff54a81d6d0 SHA512 89f0a7ca69d20a539d4b612a7028a30a5e98b402e4b6b88516f14237e5da4b626d7929eab8b40fccc90766e8f3bae87e9858a19077ffad20d8204acf18794f5b
DIST linux-5.4.tar.xz 109441440 BLAKE2B 193bc4a3147e147d5529956164ec4912fad5d5c6fb07f909ff1056e57235834173194afc686993ccd785c1ff15804de0961b625f3008cca0e27493efc8f27b13 SHA512 9f60f77e8ab972b9438ac648bed17551c8491d6585a5e85f694b2eaa4c623fbc61eb18419b2656b6795eac5deec0edaa04547fc6723fbda52256bd7f3486898f
-DIST patch-4.14.274.xz 4657512 BLAKE2B 108d13d6608df269e2a2b95ab8316a7746b6b2dd472e0aabc85fca10b1c03b2957aaa2b58117c58b0b601b283b9ad0ff876cbe8c6da626a442ea089370d2468a SHA512 98cf067682114788998659f1ccd130266a7b80c0b13e5a54ee7320df91b1d02420062d95fda5ec2a03ff3af065716085ecee2dfdba3265f74612f89aace8bc49
+DIST patch-4.14.275.xz 4662124 BLAKE2B b10c0c0482a7e363c45d5980c558958dbd2bfb906c898776eefbc161b4ea540a43730ae45a732c553896bb65853540f0bd5b094390b5ec71527f6eaa726da451 SHA512 13dea681ee50f29221700e98c7552c11673b6787ec0c5c8d4c9ab72c5a5dcf90231bccb4ae1a9601e5a0574e6c2733861f8d3f4382b266c8e2b6f79b19bca1f0
DIST patch-4.19.237.xz 4541096 BLAKE2B e1bfd5d4d618c3a4b8a0bbdc3a20d63658d0893abcb37d8db64dd24c8106e7581e14f3553f0b35d65369a2eb0a1ab57f6cc2febdea3f573f85c07f14ab155075 SHA512 c454ee3defbd609972b85211e93ccf032e3ccdf3e5a04f049143b8eedd310704a32b498dd79becc64e6172ba73e39c0e179fb03015595a2d3f2ddd0163da764e
DIST patch-4.9.309.xz 4271628 BLAKE2B 9a5f1e54637db49561db2312d627ca07f540289f6c75f32d763d8fbe3b394b93765f7fc50a38ced4a81f95159b77ab00f52315067eeb5a9cad82485976073d1c SHA512 8ed8b9d5fc8480684ef45af2584a9a65f1f7d2502ea9b9b31b846a8cc70a2f3a60f4e61f2901b1bc2ca3c7dd63400d0209951ce3835845a25f774d5bf9cabace
DIST patch-5.10.109.xz 2872316 BLAKE2B 7190e008855bfe0697806a15dec4e7babbd5159af2b7109d50a598f7c7ea53661b5afb86ad341f515a64d72c82e203241722df282a68a24742472b3ce4677143 SHA512 857028984882fe1945133bbcb5660c795e9f3616fd202a87f26ad6ff2063d2b3a0a5efb17bc905433aa2400163ba9bf7340c9283ea3573b49e9eed2eda332eb2
diff --git a/sys-kernel/vanilla-sources/vanilla-sources-4.14.274.ebuild b/sys-kernel/vanilla-sources/vanilla-sources-4.14.275.ebuild
index 39693afef068..39693afef068 100644
--- a/sys-kernel/vanilla-sources/vanilla-sources-4.14.274.ebuild
+++ b/sys-kernel/vanilla-sources/vanilla-sources-4.14.275.ebuild
diff --git a/sys-libs/compiler-rt-sanitizers/Manifest b/sys-libs/compiler-rt-sanitizers/Manifest
index ee1bf82ebf5b..f84d757645ce 100644
--- a/sys-libs/compiler-rt-sanitizers/Manifest
+++ b/sys-libs/compiler-rt-sanitizers/Manifest
@@ -3,7 +3,7 @@ DIST llvm-gentoo-patchset-12.0.1.tar.xz 5280 BLAKE2B 963d005bc7b636570be90eb841a
DIST llvm-gentoo-patchset-13.0.0-r3.tar.xz 10176 BLAKE2B fc5825a4bd3b85bd9c970901e5e036cc4c928373495a8a6f63c7f4531c7f52575d06f80dfbd80671d9f0fcd32d5c48d96f5961602b024c7a936362aeba8a612a SHA512 2289eef3f6301ade2e1110ebc4b66ad3db91ed10868ca7296a29c55667007e06739b01f38c0783bb2c56deadfb8a04605c370df9c5a4c6bc9aea9382e6ed52a5
DIST llvm-gentoo-patchset-13.0.0.tar.xz 5012 BLAKE2B 6760c78c086aaf6629143fd920b0a2c68cad9278628fbea8164dfeb59db95984a5b5d6b3505b510c697e8c95bf8d2be782c6b73c01622d52f2da9b07ecff39e0 SHA512 7764d49343b795b6bebae64f646ba27e3e6cc2a20b8a1aee645ce0d8474633c34acfbb73c08546fee415755dd4ea5a98c1d84db5e394cf5f4fc802eb61148ab6
DIST llvm-gentoo-patchset-13.0.1.tar.xz 6288 BLAKE2B 899222b962486e924e4f8a2b574d285531a3f87af9385ff68c81db92aa224a0cde6d4ee049b5405056bedb4b232b50e1d5840024071a4a215f6311853304c92d SHA512 b2805337f1deca626768a44c5e7ac9ed16e0c31bead1647d44a493a8123c1b8e8f1c8ceee3536bcc6fa87fdd3fcec408229f701adf30eff07e7ef9889b847b01
-DIST llvm-gentoo-patchset-14.0.0.tar.xz 4076 BLAKE2B dc114e53fb878ca74489c420506b9dd9c417e2b97dff4d9441d78a0a256ca1e7243ea2ce38b8665d37b0f24436f9ea5771cd05d9b13887e7370a19ec5e05ba20 SHA512 7f7d08fc762d634692fb251a51c0d73a4a9098907f25451b9ca9453315b603331b65a454b2d631cfecbb3fbc11ab3a36f644c0d7b03e1bb8e96ce4aa08d60615
+DIST llvm-gentoo-patchset-14.0.0-r2.tar.xz 7872 BLAKE2B 529986a4be1c876d625b09b0cee7cc22cd0dd883770d7f0ef6aeec79fe2da822bf67a5121602af22722962d54a65352242c3ae643060c778c728ed67917b3470 SHA512 7a7bb329facfe60875d7e4df9da120aaa314ed08ed73f00f953c0e9b235bbe7f68a4d75241e6457407fa795ad1a0fde5ede4ce95dce3b046d44cab20e7be86ac
DIST llvm-gentoo-patchset-9999-1.tar.xz 4032 BLAKE2B b9413484dafed8ae0c68c2c164b45fd07bb8d5d0898f03abe118fd2120ffcb1fb6c949de9649a97c2e8105f24b9d131a725c67c0a502ca4d4d192c1a0d65f49d SHA512 e64449eeaf756c5bd945109937b84ba4bd8a015222bd792d39cf3947871e87571a4ca57814790e51544cb05ad4c2d1f044e818e4caaac7c2e2a02cb1aa290fcc
DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
diff --git a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.ebuild b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.ebuild
index b0a36755b564..4a0fae4b09bb 100644
--- a/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.ebuild
+++ b/sys-libs/compiler-rt-sanitizers/compiler-rt-sanitizers-14.0.0.ebuild
@@ -51,7 +51,7 @@ BDEPEND="
LLVM_COMPONENTS=( compiler-rt cmake )
LLVM_TEST_COMPONENTS=( llvm/lib/Testing/Support llvm/utils/unittest )
-LLVM_PATCHSET=${PV/_/-}
+LLVM_PATCHSET=${PV/_/-}-r2
llvm.org_set_globals
python_check_deps() {