Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 12/30] python-utils-r1.eclass: Add a verbose python_has_version() wrapper
Date: Sun, 06 Feb 2022 12:52:55
Message-Id: 20220206124841.1299133-13-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/30] One batch of Python eclass updates to rule them all by "Michał Górny"
1 Add a python_has_version() wrapper that runs has_version in a verbose
2 way that makes python_check_deps() failures easier to understand.
3
4 Signed-off-by: Michał Górny <mgorny@g.o>
5 ---
6 eclass/python-utils-r1.eclass | 16 ++++++++++++++++
7 1 file changed, 16 insertions(+)
8
9 diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
10 index 3d938f5ee74f..c3726437cb68 100644
11 --- a/eclass/python-utils-r1.eclass
12 +++ b/eclass/python-utils-r1.eclass
13 @@ -1380,5 +1380,21 @@ _python_run_check_deps() {
14 eend ${?}
15 }
16
17 +# @FUNCTION: python_has_version
18 +# @USAGE: [-b|-d|-r] <atom>
19 +# @DESCRIPTION:
20 +# A wrapper for has_version() with verbose output suitable for
21 +# python_check_deps.
22 +python_has_version() {
23 + debug-print-function ${FUNCNAME} "${@}"
24 +
25 + local pkg=${1}
26 + [[ ${pkg} == -* ]] && pkg=${2}
27 +
28 + ebegin " ${pkg}"
29 + has_version "${@}"
30 + eend ${?}
31 +}
32 +
33 _PYTHON_UTILS_R1=1
34 fi
35 --
36 2.35.1