From 9aa80713372911cec499b3adb2cd746790920916 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 29 Jun 2021 10:15:54 +0100 Subject: gentoo resync : 29.06.2021 --- eclass/distutils-r1.eclass | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'eclass/distutils-r1.eclass') diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index cc0416fb1d9e..344aa46b2f94 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -421,7 +421,7 @@ distutils_enable_tests() { test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]" else test_deps+=" $(python_gen_cond_dep " - ${test_pkg}[\${PYTHON_MULTI_USEDEP}] + ${test_pkg}[\${PYTHON_USEDEP}] ")" fi fi @@ -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 @@ -740,24 +755,23 @@ distutils-r1_python_compile() { } # @FUNCTION: _distutils-r1_wrap_scripts -# @USAGE: +# @USAGE: # @INTERNAL # @DESCRIPTION: # Moves and wraps all installed scripts/executables as necessary. _distutils-r1_wrap_scripts() { debug-print-function ${FUNCNAME} "${@}" - [[ ${#} -eq 2 ]] || die "usage: ${FUNCNAME} " - local path=${1} - local bindir=${2} + [[ ${#} -eq 1 ]] || die "usage: ${FUNCNAME} " + local bindir=${1} local scriptdir=$(python_get_scriptdir) local f python_files=() non_python_files=() - if [[ -d ${path}${scriptdir} ]]; then - for f in "${path}${scriptdir}"/*; do + if [[ -d ${D%/}${scriptdir} ]]; then + for f in "${D%/}${scriptdir}"/*; do [[ -d ${f} ]] && die "Unexpected directory: ${f}" - debug-print "${FUNCNAME}: found executable at ${f#${path}/}" + debug-print "${FUNCNAME}: found executable at ${f#${D%/}/}" local shebang read -r shebang < "${f}" @@ -769,7 +783,7 @@ _distutils-r1_wrap_scripts() { non_python_files+=( "${f}" ) fi - mkdir -p "${path}${bindir}" || die + mkdir -p "${D%/}${bindir}" || die done for f in "${python_files[@]}"; do @@ -778,15 +792,15 @@ _distutils-r1_wrap_scripts() { debug-print "${FUNCNAME}: installing wrapper at ${bindir}/${basename}" local dosym=dosym [[ ${EAPI} == [67] ]] && dosym=dosym8 - "${dosym}" -r "${path#${D}}"/usr/lib/python-exec/python-exec2 \ - "${path#${D}}${bindir#${EPREFIX}}/${basename}" + "${dosym}" -r /usr/lib/python-exec/python-exec2 \ + "${bindir#${EPREFIX}}/${basename}" done for f in "${non_python_files[@]}"; do local basename=${f##*/} - debug-print "${FUNCNAME}: moving ${f#${path}/} to ${bindir}/${basename}" - mv "${f}" "${path}${bindir}/${basename}" || die + debug-print "${FUNCNAME}: moving ${f#${D%/}/} to ${bindir}/${basename}" + mv "${f}" "${D%/}${bindir}/${basename}" || die done fi } @@ -923,8 +937,8 @@ distutils-r1_python_install() { fi if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then - _distutils-r1_wrap_scripts "${root}" "${scriptdir}" multibuild_merge_root "${root}" "${D%/}" + _distutils-r1_wrap_scripts "${scriptdir}" fi } @@ -933,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 } -- cgit v1.2.3