• [gentoo-dev] [PATCH 04/18] distutils-r1.eclass: Move install QA checks

    From =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?@21:1/5 to All on Sat Jun 4 11:10:01 2022
    Perform the install QA check (the invalid package name check) in a post-
    phase function. This enables it to be performed even when distutils-r1_python_install is not used.

    Signed-off-by: Michał Górny <mgorny@gentoo.org>
    ---
    eclass/distutils-r1.eclass | 54 ++++++++++++++++++++++----------------
    1 file changed, 31 insertions(+), 23 deletions(-)

    diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
    index b690f21f9159..30391ad67f3a 100644
    --- a/eclass/distutils-r1.eclass
    +++ b/eclass/distutils-r1.eclass
    @@ -1566,29 +1566,6 @@ distutils-r1_python_install() {
    esetup.py "${args[@]}"
    fi

    - local forbidden_package_names=(
    - examples test tests
    - .pytest_cache .hypothesis
    - )
    - local p
    - for p in "${forbidden_package_names[@]}"; do
    - if [[ -d ${root}$(python_get_sitedir)/${p} ]]; then
    - die "Package installs '${p}' package which is forbidden and likely a bug in the build system."
    - fi
    - done
    -
    - local shopt_save=$(shopt -p nullglob)
    - shopt -s nullglob
    - local pypy_dirs=(
    - "${root}${EPREFIX}/usr/$(get_libdir)"/pypy*/share
    - "${root}${EPREFIX}/usr/lib"/pypy*/share
    - )
    - ${shopt_save}
    -
    - if [[ -n ${pypy_dirs} ]]; then
    - die "Package installs 'share' in PyPy prefix, see bu