diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-06-28 13:02:43 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-06-29 08:04:59 +0200 |
commit | e9d7a718bdee8127b30fb55842f534cb4b0fb0ed (patch) | |
tree | 34fd36a4de6370b5ea0b6049e76e25e683ed9db8 /eclass | |
parent | python-utils-r1.eclass: Remove _python_ln_rel (diff) | |
download | gentoo-e9d7a718bdee8127b30fb55842f534cb4b0fb0ed.tar.gz gentoo-e9d7a718bdee8127b30fb55842f534cb4b0fb0ed.tar.bz2 gentoo-e9d7a718bdee8127b30fb55842f534cb4b0fb0ed.zip |
distutils-r1.eclass: Check for _all phase mismatch
Check for the mistake of calling distutils-r1_python_*_all() from
non-all python_*() subphase.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/distutils-r1.eclass | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index e2cafb425c3a..344aa46b2f94 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -616,6 +616,20 @@ _distutils-r1_handle_pyproject_toml() { fi } +# @FUNCTION: _distutils-r1_check_all_phase_mismatch +# @DESCRIPTION: +# Verify whether *_all phase impls is not called from from non-*_all +# subphase. +_distutils-r1_check_all_phase_mismatch() { + if has "python_${EBUILD_PHASE}" "${FUNCNAME[@]}"; then + eqawarn "QA Notice: distutils-r1_python_${EBUILD_PHASE}_all called" + eqawarn "from python_${EBUILD_PHASE}. Did you mean to use" + eqawarn "python_${EBUILD_PHASE}_all()?" + [[ ${EAPI} != [67] ]] && + die "distutils-r1_python_${EBUILD_PHASE}_all called from python_${EBUILD_PHASE}." + fi +} + # @FUNCTION: distutils-r1_python_prepare_all # @DESCRIPTION: # The default python_prepare_all(). It applies the patches from PATCHES @@ -626,6 +640,7 @@ _distutils-r1_handle_pyproject_toml() { # distutils patches and/or quirks. distutils-r1_python_prepare_all() { debug-print-function ${FUNCNAME} "${@}" + _distutils-r1_check_all_phase_mismatch if [[ ! ${DISTUTILS_OPTIONAL} ]]; then default @@ -932,6 +947,7 @@ distutils-r1_python_install() { # The default python_install_all(). It installs the documentation. distutils-r1_python_install_all() { debug-print-function ${FUNCNAME} "${@}" + _distutils-r1_check_all_phase_mismatch einstalldocs } |