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: Tue, 07 Jun 2022 06:54:56
Message-Id: 1654584824.033ffdfa2348fe955ee2b6da60140d99a9e8e026.mgorny@gentoo
1 commit: 033ffdfa2348fe955ee2b6da60140d99a9e8e026
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Tue May 31 08:21:53 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 7 06:53:44 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=033ffdfa
7
8 distutils-r1.eclass: Support internal post-python_* phase functions
9
10 Support running additional post-python_* phase functions for internal
11 usage. The goal is to replace some of the inline logic
12 in distutils-r1_python_* functions that relies on the user calling them
13 and additional calls to python_foreach_impl.
14
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 eclass/distutils-r1.eclass | 6 ++++++
18 1 file changed, 6 insertions(+)
19
20 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
21 index ed368da79896..d6fd176192de 100644
22 --- a/eclass/distutils-r1.eclass
23 +++ b/eclass/distutils-r1.eclass
24 @@ -1687,6 +1687,11 @@ distutils-r1_run_phase() {
25 fi
26
27 cd "${_DISTUTILS_INITIAL_CWD}" || die
28 + if [[ ! ${_DISTUTILS_IN_COMMON_IMPL} ]] &&
29 + declare -f "_distutils-r1_post_python_${EBUILD_PHASE}" >/dev/null
30 + then
31 + "_distutils-r1_post_python_${EBUILD_PHASE}"
32 + fi
33 return "${ret}"
34 }
35
36 @@ -1701,6 +1706,7 @@ distutils-r1_run_phase() {
37 # of sources made for the selected Python interpreter.
38 _distutils-r1_run_common_phase() {
39 local DISTUTILS_ORIG_BUILD_DIR=${BUILD_DIR}
40 + local _DISTUTILS_IN_COMMON_IMPL=1
41
42 if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
43 # reuse the dedicated code branch