summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-02-04 15:28:48 +0100
committerMichał Górny <mgorny@gentoo.org>2022-02-09 09:43:43 +0100
commitd918d2e7cb96b5cbb4aab5278acd5e511d52b9e4 (patch)
tree65b9a2626012b0e17af6c2411cd5e4637b63cb17 /eclass/python-utils-r1.eclass
parentpython-any-r1.eclass: Move EPYTHON validity check to python_setup() (diff)
downloadgentoo-d918d2e7cb96b5cbb4aab5278acd5e511d52b9e4.tar.gz
gentoo-d918d2e7cb96b5cbb4aab5278acd5e511d52b9e4.tar.bz2
gentoo-d918d2e7cb96b5cbb4aab5278acd5e511d52b9e4.zip
python-utils-r1.eclass: Add function to run python_check_deps()
Add a function encompassing the common logic to run python_check_deps() from python-any-r1 and python-r1. Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/python-utils-r1.eclass')
-rw-r--r--eclass/python-utils-r1.eclass20
1 files changed, 20 insertions, 0 deletions
diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index c8367f8065f4..f8c0c00ce919 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -1368,5 +1368,25 @@ eunittest() {
return ${?}
}
+# @FUNCTION: _python_run_check_deps
+# @INTERNAL
+# @USAGE: <impl>
+# @DESCRIPTION:
+# Verify whether <impl> is an acceptable choice to run any-r1 style
+# code. Checks whether the interpreter is installed, runs
+# python_check_deps() if declared.
+_python_run_check_deps() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ local impl=${1}
+
+ python_is_installed "${impl}" || return 1
+ declare -f python_check_deps >/dev/null || return 0
+
+ local PYTHON_USEDEP="python_targets_${impl}(-)"
+ local PYTHON_SINGLE_USEDEP="python_single_target_${impl}(-)"
+ python_check_deps
+}
+
_PYTHON_UTILS_R1=1
fi