summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2021-07-19 22:33:03 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2021-08-03 13:13:53 +0200
commit1ed0d6fb138480c2b5a334cc656a4dee23b112a9 (patch)
tree71f84285eb47108d32e3db594207e064c69e4fdf /eclass/check-reqs.eclass
parentcheck-reqs.eclass: Make check-reqs_get_kibibytes internal (diff)
downloadgentoo-1ed0d6fb138480c2b5a334cc656a4dee23b112a9.tar.gz
gentoo-1ed0d6fb138480c2b5a334cc656a4dee23b112a9.tar.bz2
gentoo-1ed0d6fb138480c2b5a334cc656a4dee23b112a9.zip
check-reqs.eclass: Make check-reqs_get_number internal
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'eclass/check-reqs.eclass')
-rw-r--r--eclass/check-reqs.eclass15
1 files changed, 13 insertions, 2 deletions
diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index 470f52756b78..5ffff307f9ae 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -201,6 +201,17 @@ _check-reqs_get_kibibytes() {
# Internal function that returns the numerical value without the unit.
# Returns "1" for "1G" or "150" for "150T".
check-reqs_get_number() {
+ [[ ${EAPI} == [67] ]] ||
+ die "Internal function ${FUNCNAME} is not available in EAPI ${EAPI}."
+ _check-reqs_get_number "$@"
+}
+
+# @FUNCTION: _check-reqs_get_number
+# @INTERNAL
+# @DESCRIPTION:
+# Internal function that returns the numerical value without the unit.
+# Returns "1" for "1G" or "150" for "150T".
+_check-reqs_get_number() {
debug-print-function ${FUNCNAME} "$@"
[[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]"
@@ -350,7 +361,7 @@ check-reqs_start_phase() {
local size=${1}
local location=${2}
- local sizeunit="$(check-reqs_get_number ${size}) $(check-reqs_get_unit ${size})"
+ local sizeunit="$(_check-reqs_get_number ${size}) $(check-reqs_get_unit ${size})"
ebegin "Checking for at least ${sizeunit} ${location}"
}
@@ -369,7 +380,7 @@ check-reqs_unsatisfied() {
local msg="ewarn"
local size=${1}
local location=${2}
- local sizeunit="$(check-reqs_get_number ${size}) $(check-reqs_get_unit ${size})"
+ local sizeunit="$(_check-reqs_get_number ${size}) $(check-reqs_get_unit ${size})"
[[ ${EBUILD_PHASE} == "pretend" && -z ${I_KNOW_WHAT_I_AM_DOING} ]] && msg="eerror"
${msg} "There is NOT at least ${sizeunit} ${location}"