summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-06-20 11:26:23 +0200
committerMichał Górny <mgorny@gentoo.org>2021-06-23 23:44:23 +0200
commit0b8c6396d52b4d6dbd356224664208a252a6cd26 (patch)
treee32b76dfa10b8e8be23786c96659cb9d8367822f /eclass/distutils-r1.eclass
parentdistutils-r1.eclass: Refactor --install-scripts rewriting logic (diff)
downloadgentoo-0b8c6396d52b4d6dbd356224664208a252a6cd26.tar.gz
gentoo-0b8c6396d52b4d6dbd356224664208a252a6cd26.tar.bz2
gentoo-0b8c6396d52b4d6dbd356224664208a252a6cd26.zip
distutils-r1.eclass: Replace mydistutilsargs with DISTUTILS_ARGS
Add a new correctly-cased DISTUTILS_ARGS variable that replaces mydistutilsargs. Ban the latter in EAPI 8. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass23
1 files changed, 16 insertions, 7 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 217f457d6bf3..d7a476f48586 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -248,15 +248,16 @@ unset -f _distutils_set_globals
# }
# @CODE
-# @ECLASS-VARIABLE: mydistutilsargs
+# @ECLASS-VARIABLE: DISTUTILS_ARGS
# @DEFAULT_UNSET
# @DESCRIPTION:
-# An array containing options to be passed to setup.py.
+# An array containing options to be passed to setup.py. They are passed
+# before the default arguments, i.e. before the first command.
#
# Example:
# @CODE
# python_configure_all() {
-# mydistutilsargs=( --enable-my-hidden-option )
+# DISTUTILS_ARGS=( --enable-my-hidden-option )
# }
# @CODE
@@ -446,8 +447,9 @@ distutils_enable_tests() {
# (if ${EPYTHON} is set; fallback 'python' otherwise).
#
# setup.py will be passed the following, in order:
-# 1. ${mydistutilsargs[@]}
-# 2. additional arguments passed to the esetup.py function.
+# 1. ${DISTUTILS_ARGS[@]}
+# 2. ${mydistutilsargs[@]} (deprecated)
+# 3. additional arguments passed to the esetup.py function.
#
# Please note that setup.py will respect defaults (unless overridden
# via command-line options) from setup.cfg that is created
@@ -467,7 +469,12 @@ esetup.py() {
setup_py=( -m pyproject2setuppy.main )
fi
- set -- "${EPYTHON}" "${setup_py[@]}" "${mydistutilsargs[@]}" "${@}"
+ if [[ ${EAPI} != [67] && ${mydistutilsargs[@]} ]]; then
+ die "mydistutilsargs is banned in EAPI ${EAPI} (use DISTUTILS_ARGS)"
+ fi
+
+ set -- "${EPYTHON}" "${setup_py[@]}" "${DISTUTILS_ARGS[@]}" \
+ "${mydistutilsargs[@]}" "${@}"
echo "${@}" >&2
"${@}" || die -n
@@ -839,13 +846,15 @@ distutils-r1_python_install() {
local root=${D%/}/_${EPYTHON}
[[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/}
- # inline mydistutilsargs logic from esetup.py in order to make
+ # inline DISTUTILS_ARGS logic from esetup.py in order to make
# argv overwriting easier
local args=(
+ "${DISTUTILS_ARGS[@]}"
"${mydistutilsargs[@]}"
install --skip-build --root="${root}" "${args[@]}"
"${@}"
)
+ local DISTUTILS_ARGS=()
local mydistutilsargs=()
# enable compilation for the install phase.