commit:     6f05bc88c81a42943e5784736d2eb15f63c5ef40
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Jan  5 15:52:16 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jan  8 14:48:19 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6f05bc88

install-qa-check.d/60python-site: Add check for wrong libdir

Bug: https://bugs.gentoo.org/702016
Bug: https://bugs.gentoo.org/770961
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 metadata/install-qa-check.d/60python-site | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/metadata/install-qa-check.d/60python-site 
b/metadata/install-qa-check.d/60python-site
index 3ac1dc91669e..ffc06edf0960 100644
--- a/metadata/install-qa-check.d/60python-site
+++ b/metadata/install-qa-check.d/60python-site
@@ -9,6 +9,10 @@ python_site_check() {
        local save=$(shopt -p nullglob)
        shopt -s nullglob
        local progs=( "${EPREFIX}"/usr/lib/python-exec/*/gpep517 )
+       local bad_libdirs=()
+       [[ $(get_libdir) != lib ]] && bad_libdirs=(
+               "${ED}/usr/$(get_libdir)"/{python3,pypy}*
+       )
        ${save}
 
        local forbidden_package_names=(
@@ -185,6 +189,14 @@ python_site_check() {
                # the previous version from distutils-r1
                #die "Failing install because of stray top-level files in 
site-packages"
        fi
+
+       if [[ ${bad_libdirs[@]} ]]; then
+               eqawarn
+               eqawarn "QA Notice: Package installs Python files to 
/usr/$(get_libdir)"
+               eqawarn "instead of /usr/lib (use \$(python_get_sitedir)):"
+               eqawarn
+               eqatag -v python-site.libdir "${bad_libdirs[@]#${ED}}"
+       fi
 }
 
 python_site_check

Reply via email to