public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/
Date: Mon, 30 Dec 2019 16:10:20 +0000 (UTC)	[thread overview]
Message-ID: <1577722199.45df9e6b42511ed01a367ab2552b761682730c01.mgorny@gentoo> (raw)

commit:     45df9e6b42511ed01a367ab2552b761682730c01
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Dec 30 16:09:59 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Dec 30 16:09:59 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=45df9e6b

metadata/install-qa-check.d/60python-pyc: Add EAPI guard

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

 metadata/install-qa-check.d/60python-pyc | 135 ++++++++++++++++---------------
 1 file changed, 69 insertions(+), 66 deletions(-)

diff --git a/metadata/install-qa-check.d/60python-pyc b/metadata/install-qa-check.d/60python-pyc
index ef668aed995..644c27243cd 100644
--- a/metadata/install-qa-check.d/60python-pyc
+++ b/metadata/install-qa-check.d/60python-pyc
@@ -4,81 +4,84 @@
 # QA check: ensure that Python modules are compiled after installing
 # Maintainer: Python project <python@gentoo.org>
 
-inherit python-utils-r1
+if [[ ${EAPI} == [5-7] ]]; then
+	inherit python-utils-r1
 
-python_pyc_check() {
-	local impl missing=() outdated=()
-	for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
-		python_export "${impl}" EPYTHON PYTHON
-		[[ -x ${PYTHON} ]] || continue
-		local sitedir=$(python_get_sitedir "${impl}")
+	python_pyc_check() {
+		local impl missing=() outdated=()
+		for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
+			python_export "${impl}" EPYTHON PYTHON
+			[[ -x ${PYTHON} ]] || continue
+			local sitedir=$(python_get_sitedir "${impl}")
 
-		if [[ -d ${D}${sitedir} ]]; then
-			local suffixes=() subdir=
-			case ${EPYTHON} in
-				python2*)
-					suffixes=( .py{c,o} )
-					;;
-				pypy)
-					suffixes=( .pyc )
-					;;
-				python3*|pypy3*)
-					local tag=$("${PYTHON}" -c 'import sys; print(sys.implementation.cache_tag)')
-					suffixes=( ".${tag}"{,.opt-{1,2}}.pyc )
-					subdir=__pycache__/
-					;;
-				*)
-					# skip testing unknown impl
-					continue
-					;;
-			esac
+			if [[ -d ${D}${sitedir} ]]; then
+				local suffixes=() subdir=
+				case ${EPYTHON} in
+					python2*)
+						suffixes=( .py{c,o} )
+						;;
+					pypy)
+						suffixes=( .pyc )
+						;;
+					python3*|pypy3*)
+						local tag=$("${PYTHON}" -c 'import sys; print(sys.implementation.cache_tag)')
+						suffixes=( ".${tag}"{,.opt-{1,2}}.pyc )
+						subdir=__pycache__/
+						;;
+					*)
+						# skip testing unknown impl
+						continue
+						;;
+				esac
 
-			einfo "Verifying compiled files in ${sitedir}"
-			local f s
-			while read -d $'\0' -r f; do
-				local dir=${f%/*}
-				local basename=${f##*/}
-				basename=${basename%.py}
+				einfo "Verifying compiled files in ${sitedir}"
+				local f s
+				while read -d $'\0' -r f; do
+					local dir=${f%/*}
+					local basename=${f##*/}
+					basename=${basename%.py}
 
-				for s in "${suffixes[@]}"; do
-					local cache=${dir}/${subdir}${basename}${s}
-					if [[ ! -f ${cache} ]]; then
-						missing+=( "${cache}" )
-					elif [[ ${f} -nt ${cache} ]]; then
-						outdated+=( "${cache}" )
-					fi
-				done
-			done < <(find "${D}${sitedir}" -name '*.py' -print0)
+					for s in "${suffixes[@]}"; do
+						local cache=${dir}/${subdir}${basename}${s}
+						if [[ ! -f ${cache} ]]; then
+							missing+=( "${cache}" )
+						elif [[ ${f} -nt ${cache} ]]; then
+							outdated+=( "${cache}" )
+						fi
+					done
+				done < <(find "${D}${sitedir}" -name '*.py' -print0)
+			fi
+		done
+
+		if [[ ${missing[@]} ]]; then
+			eqawarn
+			eqawarn "This package installs one or more Python modules that are not byte-compiled."
+			eqawarn "The following files are missing:"
+			eqawarn
+			eqatag -v python-pyc.missing "${missing[@]#${D}}"
 		fi
-	done
 
-	if [[ ${missing[@]} ]]; then
-		eqawarn
-		eqawarn "This package installs one or more Python modules that are not byte-compiled."
-		eqawarn "The following files are missing:"
-		eqawarn
-		eqatag -v python-pyc.missing "${missing[@]#${D}}"
-	fi
+		if [[ ${outdated[@]} ]]; then
+			eqawarn
+			eqawarn "This package installs one or more compiled Python modules that have older"
+			eqawarn "timestamps than the corresponding source files:"
+			eqawarn
+			eqatag -v python-pyc.outdated "${outdated[@]#${D}}"
+		fi
 
-	if [[ ${outdated[@]} ]]; then
-		eqawarn
-		eqawarn "This package installs one or more compiled Python modules that have older"
-		eqawarn "timestamps than the corresponding source files:"
-		eqawarn
-		eqatag -v python-pyc.outdated "${outdated[@]#${D}}"
-	fi
+		if [[ ${missing[@]} || ${outdated[@]} ]]; then
+			eqawarn
+			eqawarn "Please either fix the upstream build system to byte-compile Python modules"
+			eqawarn "correctly, or call python_optimize after installing them.  For more"
+			eqawarn "information, see:"
+			eqawarn "https://wiki.gentoo.org/wiki/Project:Python/Byte_compiling"
+			eqawarn
+		fi
+	}
 
-	if [[ ${missing[@]} || ${outdated[@]} ]]; then
-		eqawarn
-		eqawarn "Please either fix the upstream build system to byte-compile Python modules"
-		eqawarn "correctly, or call python_optimize after installing them.  For more"
-		eqawarn "information, see:"
-		eqawarn "https://wiki.gentoo.org/wiki/Project:Python/Byte_compiling"
-		eqawarn
-	fi
-}
+	python_pyc_check
+fi
 
-python_pyc_check
 : # guarantee successful exit
 
 # vim:ft=ebuild


             reply	other threads:[~2019-12-30 16:10 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-30 16:10 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-21 15:12 [gentoo-commits] repo/gentoo:master commit in: metadata/install-qa-check.d/ Michał Górny
2024-09-05  8:43 Michał Górny
2024-03-29 18:47 Sam James
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2024-01-08 14:48 Michał Górny
2023-08-17 22:08 Ulrich Müller
2023-05-17  3:40 Michał Górny
2022-09-19  3:52 Sam James
2022-08-21  2:31 Sam James
2022-08-04 23:49 Sam James
2022-08-03 18:56 Sam James
2022-08-03  4:27 Sam James
2022-08-03  1:53 Sam James
2022-08-02  4:08 Michał Górny
2022-07-16 11:26 Michał Górny
2022-06-08  0:25 Mike Gilbert
2022-05-06 12:48 Ionen Wolkens
2022-05-05 23:38 Sam James
2022-05-02  6:01 Agostino Sarubbo
2022-04-30 19:13 Sam James
2022-04-28  3:06 Sam James
2022-04-27  0:13 Sam James
2022-04-26 23:45 Sam James
2022-04-26 15:32 Sam James
2022-04-19 18:31 Sam James
2022-04-19 18:31 Sam James
2022-04-17 14:21 Sam James
2022-04-17 14:18 Sam James
2022-03-04  1:26 Sam James
2022-03-04  1:26 Sam James
2022-02-01 18:19 Mike Gilbert
2022-02-01  1:37 Mike Gilbert
2022-01-16  9:40 Michał Górny
2021-08-19  1:35 Sam James
2021-08-16  2:12 Sam James
2021-08-16  2:12 Sam James
2021-08-16  2:12 Sam James
2021-08-16  2:12 Sam James
2021-08-02  8:17 Michał Górny
2021-07-03  8:16 Michał Górny
2021-07-01  8:57 Georgy Yakovlev
2021-06-28 18:47 Georgy Yakovlev
2021-06-28  8:56 Georgy Yakovlev
2021-06-28  0:12 Georgy Yakovlev
2021-06-27  2:08 Sam James
2021-06-26 23:25 Georgy Yakovlev
2021-06-26 23:09 Georgy Yakovlev
2021-05-29 15:15 Michał Górny
2021-05-25  5:13 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-29 11:42 Michał Górny
2021-04-09 23:17 Sam James
2020-10-17 19:01 Michał Górny
2020-10-16  7:42 Michał Górny
2020-09-22 11:12 Michał Górny
2020-09-22  7:33 Michał Górny
2020-09-22  7:00 Michał Górny
2020-09-22  7:00 Michał Górny
2020-09-21 17:48 Michał Górny
2020-09-21 15:30 Michał Górny
2020-02-13 18:59 Georgy Yakovlev
2020-01-20 20:45 Michael Orlitzky
2019-11-12  7:53 Sergei Trofimovich
2019-11-11 23:05 Zac Medico
2019-11-11 22:25 Sergei Trofimovich
2019-11-01 13:16 Michał Górny
2018-10-06  8:35 Michał Górny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1577722199.45df9e6b42511ed01a367ab2552b761682730c01.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox