Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Wed, 23 Jun 2021 21:44:41
Message-Id: 1624484663.0b8c6396d52b4d6dbd356224664208a252a6cd26.mgorny@gentoo
1 commit: 0b8c6396d52b4d6dbd356224664208a252a6cd26
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jun 20 09:26:23 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 23 21:44:23 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b8c6396
7
8 distutils-r1.eclass: Replace mydistutilsargs with DISTUTILS_ARGS
9
10 Add a new correctly-cased DISTUTILS_ARGS variable that replaces
11 mydistutilsargs. Ban the latter in EAPI 8.
12
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 eclass/distutils-r1.eclass | 23 ++++++++++++++++-------
16 1 file changed, 16 insertions(+), 7 deletions(-)
17
18 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
19 index 217f457d6bf..d7a476f4858 100644
20 --- a/eclass/distutils-r1.eclass
21 +++ b/eclass/distutils-r1.eclass
22 @@ -248,15 +248,16 @@ unset -f _distutils_set_globals
23 # }
24 # @CODE
25
26 -# @ECLASS-VARIABLE: mydistutilsargs
27 +# @ECLASS-VARIABLE: DISTUTILS_ARGS
28 # @DEFAULT_UNSET
29 # @DESCRIPTION:
30 -# An array containing options to be passed to setup.py.
31 +# An array containing options to be passed to setup.py. They are passed
32 +# before the default arguments, i.e. before the first command.
33 #
34 # Example:
35 # @CODE
36 # python_configure_all() {
37 -# mydistutilsargs=( --enable-my-hidden-option )
38 +# DISTUTILS_ARGS=( --enable-my-hidden-option )
39 # }
40 # @CODE
41
42 @@ -446,8 +447,9 @@ distutils_enable_tests() {
43 # (if ${EPYTHON} is set; fallback 'python' otherwise).
44 #
45 # setup.py will be passed the following, in order:
46 -# 1. ${mydistutilsargs[@]}
47 -# 2. additional arguments passed to the esetup.py function.
48 +# 1. ${DISTUTILS_ARGS[@]}
49 +# 2. ${mydistutilsargs[@]} (deprecated)
50 +# 3. additional arguments passed to the esetup.py function.
51 #
52 # Please note that setup.py will respect defaults (unless overridden
53 # via command-line options) from setup.cfg that is created
54 @@ -467,7 +469,12 @@ esetup.py() {
55 setup_py=( -m pyproject2setuppy.main )
56 fi
57
58 - set -- "${EPYTHON}" "${setup_py[@]}" "${mydistutilsargs[@]}" "${@}"
59 + if [[ ${EAPI} != [67] && ${mydistutilsargs[@]} ]]; then
60 + die "mydistutilsargs is banned in EAPI ${EAPI} (use DISTUTILS_ARGS)"
61 + fi
62 +
63 + set -- "${EPYTHON}" "${setup_py[@]}" "${DISTUTILS_ARGS[@]}" \
64 + "${mydistutilsargs[@]}" "${@}"
65
66 echo "${@}" >&2
67 "${@}" || die -n
68 @@ -839,13 +846,15 @@ distutils-r1_python_install() {
69 local root=${D%/}/_${EPYTHON}
70 [[ ${DISTUTILS_SINGLE_IMPL} ]] && root=${D%/}
71
72 - # inline mydistutilsargs logic from esetup.py in order to make
73 + # inline DISTUTILS_ARGS logic from esetup.py in order to make
74 # argv overwriting easier
75 local args=(
76 + "${DISTUTILS_ARGS[@]}"
77 "${mydistutilsargs[@]}"
78 install --skip-build --root="${root}" "${args[@]}"
79 "${@}"
80 )
81 + local DISTUTILS_ARGS=()
82 local mydistutilsargs=()
83
84 # enable compilation for the install phase.