summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-02-04 15:38:08 +0100
committerMichał Górny <mgorny@gentoo.org>2022-02-09 09:43:46 +0100
commitbcf57dbbf5dabb3fd7c711f74c1de3dcc6c2d139 (patch)
tree36ba7a1f55c5f6135347751fcb1b40c90016c0fd /eclass
parentpython-utils-r1.eclass: Report _python_run_check_deps verbosely (diff)
downloadgentoo-bcf57dbbf5dabb3fd7c711f74c1de3dcc6c2d139.tar.gz
gentoo-bcf57dbbf5dabb3fd7c711f74c1de3dcc6c2d139.tar.bz2
gentoo-bcf57dbbf5dabb3fd7c711f74c1de3dcc6c2d139.zip
python-utils-r1.eclass: Inline python_is_installed
Inline the python_is_installed function that is used exactly once (in _python_run_check_deps). This helps us avoid having to grab PYTHON_PKG_DEP twice. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/python-utils-r1.eclass22
1 files changed, 3 insertions, 19 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 2a83ef463ffd..3d938f5ee74f 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -995,24 +995,6 @@ python_is_python3() {
[[ ${impl} == python3* || ${impl} == pypy3 ]]
}
-# @FUNCTION: python_is_installed
-# @USAGE: [<impl>]
-# @DESCRIPTION:
-# Check whether the interpreter for <impl> (or ${EPYTHON}) is installed.
-# Uses has_version with a proper dependency string.
-#
-# Returns 0 (true) if it is, 1 (false) otherwise.
-python_is_installed() {
- local impl=${1:-${EPYTHON}}
- [[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON"
- local hasv_args=( -b )
- [[ ${EAPI} == 6 ]] && hasv_args=( --host-root )
-
- local PYTHON_PKG_DEP
- _python_export "${impl}" PYTHON_PKG_DEP
- has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}"
-}
-
# @FUNCTION: python_fix_shebang
# @USAGE: [-f|--force] [-q|--quiet] <path>...
# @DESCRIPTION:
@@ -1379,13 +1361,15 @@ _python_run_check_deps() {
debug-print-function ${FUNCNAME} "${@}"
local impl=${1}
+ local hasv_args=( -b )
+ [[ ${EAPI} == 6 ]] && hasv_args=( --host-root )
einfo "Checking whether ${impl} is suitable ..."
local PYTHON_PKG_DEP
_python_export "${impl}" PYTHON_PKG_DEP
ebegin " ${PYTHON_PKG_DEP}"
- python_is_installed "${impl}"
+ has_version "${hasv_args[@]}" "${PYTHON_PKG_DEP}"
eend ${?} || return 1
declare -f python_check_deps >/dev/null || return 0