summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2024-01-05 15:38:25 +0100
committerMichał Górny <mgorny@gentoo.org>2024-01-08 15:48:17 +0100
commit2c6e23dbd6f73f662da1832fc993c61f8945b83e (patch)
tree878c6895a9a9cc334bf3539f342687c83e4df9e4 /metadata/install-qa-check.d/60python-site
parentinstall-qa-check.d/60python-site: Add invalid site-packages check (diff)
downloadgentoo-2c6e23dbd6f73f662da1832fc993c61f8945b83e.tar.gz
gentoo-2c6e23dbd6f73f662da1832fc993c61f8945b83e.tar.bz2
gentoo-2c6e23dbd6f73f662da1832fc993c61f8945b83e.zip
install-qa-check.d/60python-site: Add bad version check
This was a case e.g. with =dev-python/pyrqlite-2.2.0. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'metadata/install-qa-check.d/60python-site')
-rw-r--r--metadata/install-qa-check.d/60python-site21
1 files changed, 21 insertions, 0 deletions
diff --git a/metadata/install-qa-check.d/60python-site b/metadata/install-qa-check.d/60python-site
index eb59ad5cac26..d73c881d3ad1 100644
--- a/metadata/install-qa-check.d/60python-site
+++ b/metadata/install-qa-check.d/60python-site
@@ -24,6 +24,7 @@ python_site_check() {
local missing=()
local stray=()
+ local bad_versions=()
local stray_packages=()
# Avoid running the check if sufficiently new gpep517 is not installed
@@ -42,6 +43,18 @@ python_site_check() {
local sitedir=( "${ED}"/usr/lib/${impl}*/site-packages )
[[ -d ${sitedir} ]] || continue
+ # check for bad package versions
+ while IFS= read -d $'\0' -r f; do
+ bad_versions+=( "${f#${ED}}" )
+ done < <(
+ find "${sitedir}" -maxdepth 1 '(' \
+ -name '*-0.0.0.dist-info' -o \
+ -name '*-UNKNOWN.dist-info' -o \
+ -name '*-0.0.0.egg-info' -o \
+ -name '*-UNKNOWN.egg-info' \
+ ')' -print0
+ )
+
# check for stray files in site-packages
while IFS= read -d $'\0' -r f; do
stray_packages+=( "${f#${ED}}" )
@@ -148,6 +161,14 @@ python_site_check() {
eqawarn " https://projects.gentoo.org/python/guide/qawarn.html#compiled-bytecode-related-warnings"
fi
+ if [[ ${bad_versions[@]} ]]; then
+ eqawarn
+ eqawarn "QA Notice: The following Python packages were installed with"
+ eqawarn "invalid/suspicious versions in the site-packages directory:"
+ eqawarn
+ eqatag -v python-site.bad_version "${bad_versions[@]}"
+ fi
+
if [[ ${stray_packages[@]} ]]; then
eqawarn
eqawarn "QA Notice: The following unexpected files/directories were found"