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, 29 Jun 2021 06:05:10
Message-Id: 1624946699.e9d7a718bdee8127b30fb55842f534cb4b0fb0ed.mgorny@gentoo
1 commit: e9d7a718bdee8127b30fb55842f534cb4b0fb0ed
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Mon Jun 28 11:02:43 2021 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 29 06:04:59 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e9d7a718
7
8 distutils-r1.eclass: Check for _all phase mismatch
9
10 Check for the mistake of calling distutils-r1_python_*_all() from
11 non-all python_*() subphase.
12
13 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
14
15 eclass/distutils-r1.eclass | 16 ++++++++++++++++
16 1 file changed, 16 insertions(+)
17
18 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
19 index e2cafb425c3..344aa46b2f9 100644
20 --- a/eclass/distutils-r1.eclass
21 +++ b/eclass/distutils-r1.eclass
22 @@ -616,6 +616,20 @@ _distutils-r1_handle_pyproject_toml() {
23 fi
24 }
25
26 +# @FUNCTION: _distutils-r1_check_all_phase_mismatch
27 +# @DESCRIPTION:
28 +# Verify whether *_all phase impls is not called from from non-*_all
29 +# subphase.
30 +_distutils-r1_check_all_phase_mismatch() {
31 + if has "python_${EBUILD_PHASE}" "${FUNCNAME[@]}"; then
32 + eqawarn "QA Notice: distutils-r1_python_${EBUILD_PHASE}_all called"
33 + eqawarn "from python_${EBUILD_PHASE}. Did you mean to use"
34 + eqawarn "python_${EBUILD_PHASE}_all()?"
35 + [[ ${EAPI} != [67] ]] &&
36 + die "distutils-r1_python_${EBUILD_PHASE}_all called from python_${EBUILD_PHASE}."
37 + fi
38 +}
39 +
40 # @FUNCTION: distutils-r1_python_prepare_all
41 # @DESCRIPTION:
42 # The default python_prepare_all(). It applies the patches from PATCHES
43 @@ -626,6 +640,7 @@ _distutils-r1_handle_pyproject_toml() {
44 # distutils patches and/or quirks.
45 distutils-r1_python_prepare_all() {
46 debug-print-function ${FUNCNAME} "${@}"
47 + _distutils-r1_check_all_phase_mismatch
48
49 if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
50 default
51 @@ -932,6 +947,7 @@ distutils-r1_python_install() {
52 # The default python_install_all(). It installs the documentation.
53 distutils-r1_python_install_all() {
54 debug-print-function ${FUNCNAME} "${@}"
55 + _distutils-r1_check_all_phase_mismatch
56
57 einstalldocs
58 }