Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 09/25] python-utils-r2.eclass: Mark python_is_installed private
Date: Sat, 29 Feb 2020 20:45:28
Message-Id: 20200229204201.99290-10-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 00/25] python-r2 eclass suite by "Michał Górny"
1 Signed-off-by: Michał Górny <mgorny@g.o>
2 ---
3 eclass/python-any-r2.eclass | 2 +-
4 eclass/python-r2.eclass | 2 +-
5 eclass/python-utils-r2.eclass | 5 +++--
6 3 files changed, 5 insertions(+), 4 deletions(-)
7
8 diff --git a/eclass/python-any-r2.eclass b/eclass/python-any-r2.eclass
9 index 05e614ca4899..bedd4aa6cae1 100644
10 --- a/eclass/python-any-r2.eclass
11 +++ b/eclass/python-any-r2.eclass
12 @@ -259,7 +259,7 @@ _python_EPYTHON_supported() {
13 esac
14
15 if has "${i}" "${_PYTHON_SUPPORTED_IMPLS[@]}"; then
16 - if python_is_installed "${i}"; then
17 + if _python_is_installed "${i}"; then
18 if declare -f python_check_deps >/dev/null; then
19 local PYTHON_USEDEP="python_targets_${i}(-),python_single_target_${i}(+)"
20 python_check_deps
21 diff --git a/eclass/python-r2.eclass b/eclass/python-r2.eclass
22 index feb8229eb2c5..4dac2513c12b 100644
23 --- a/eclass/python-r2.eclass
24 +++ b/eclass/python-r2.eclass
25 @@ -720,7 +720,7 @@ python_setup() {
26 # if python_check_deps() is declared, switch into any-of mode
27 if [[ ${has_check_deps} ]]; then
28 # first check if the interpreter is installed
29 - python_is_installed "${impl}" || continue
30 + _python_is_installed "${impl}" || continue
31 # then run python_check_deps
32 local PYTHON_USEDEP="python_targets_${impl}(-),python_single_target_${impl}(+)"
33 python_check_deps || continue
34 diff --git a/eclass/python-utils-r2.eclass b/eclass/python-utils-r2.eclass
35 index f0d8f366c050..bbd1802e3e7a 100644
36 --- a/eclass/python-utils-r2.eclass
37 +++ b/eclass/python-utils-r2.eclass
38 @@ -1059,14 +1059,15 @@ python_is_python3() {
39 [[ ${impl} == python3* || ${impl} == pypy3 ]]
40 }
41
42 -# @FUNCTION: python_is_installed
43 +# @FUNCTION: _python_is_installed
44 # @USAGE: [<impl>]
45 +# @INTERNAL
46 # @DESCRIPTION:
47 # Check whether the interpreter for <impl> (or ${EPYTHON}) is installed.
48 # Uses has_version with a proper dependency string.
49 #
50 # Returns 0 (true) if it is, 1 (false) otherwise.
51 -python_is_installed() {
52 +_python_is_installed() {
53 local impl=${1:-${EPYTHON}}
54 [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON"
55 local hasv_args=()
56 --
57 2.25.1