diff options
author | Michał Górny <mgorny@gentoo.org> | 2023-04-19 16:27:42 +0200 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-04-23 21:49:26 +0100 |
commit | 6a21e8643a56f91c724f23d652fb43ead5c1e2af (patch) | |
tree | 910e74f50b6702d9d8cb27ffbe6cf0c5bf4322d0 /bin/install-qa-check.d | |
parent | econf: Match configure --help output better (diff) | |
download | portage-6a21e8643a56f91c724f23d652fb43ead5c1e2af.tar.gz portage-6a21e8643a56f91c724f23d652fb43ead5c1e2af.tar.bz2 portage-6a21e8643a56f91c724f23d652fb43ead5c1e2af.zip |
install-qa-check.d: Add a install log check for missing dev-python/cython dep
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Closes: https://github.com/gentoo/portage/pull/1024
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'bin/install-qa-check.d')
-rw-r--r-- | bin/install-qa-check.d/90cython-dep | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/bin/install-qa-check.d/90cython-dep b/bin/install-qa-check.d/90cython-dep new file mode 100644 index 000000000..4932c0242 --- /dev/null +++ b/bin/install-qa-check.d/90cython-dep @@ -0,0 +1,45 @@ +# Check for missing dev-python/cython dep based on output +# from setuptools cythonize() support + +cython_dep_check() { + [[ ${CATEGORY}/${PN} == dev-python/cython ]] && return + # grepping log files is expensive, so do it only for ebuilds using + # distutils-r1 + has distutils-r1 ${INHERITED} || return + [[ ${BDEPEND} == *dev-python/cython* ]] && return + + # Evaluate misc gcc warnings + if [[ -n ${PORTAGE_LOG_FILE} && -r ${PORTAGE_LOG_FILE} ]] ; then + # In debug mode, the grep calls will produce false positives + # if they're shown in the trace. + local reset_debug=0 + if [[ ${-/x/} != $- ]] ; then + set +x + reset_debug=1 + fi + + local grep_cmd=grep + [[ ${PORTAGE_LOG_FILE} = *.gz ]] && grep_cmd=zgrep + + # Force C locale to work around slow multibyte locales, bug #160234 + # Force text mode as newer grep will treat non-ASCII (e.g. UTF-8) as + # binary when we run in the C locale. + local f=$( + LC_CTYPE=C LC_COLLATE=C "${grep_cmd}" -a "Cythonizing" \ + "${PORTAGE_LOG_FILE}" | uniq + ) + if [[ -n ${f} ]] ; then + __vecho -ne '\n' + eqawarn "QA Notice: Package seems to be missing a BDEPEND on dev-python/cython." + eqawarn "${f}" + __vecho -ne '\n' + fi + + [[ ${reset_debug} = 1 ]] && set -x + fi +} + +cython_dep_check +: # guarantee successful exit + +# vim:ft=sh |