Bug: https://bugs.gentoo.org/702016
Bug: https://bugs.gentoo.org/770961
Signed-off-by: Michał Górny <mgo...@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 3fd697605a70..facc41fbb060 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=(
@@ -183,6 +187,14 @@ python_site_check() {
                eqawarn 
"https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages";
                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
-- 
2.43.0


Reply via email to