diff options
Diffstat (limited to 'eclass/check-reqs.eclass')
-rw-r--r-- | eclass/check-reqs.eclass | 37 |
1 files changed, 7 insertions, 30 deletions
diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass index fe1852213441..bad7e34fe9a7 100644 --- a/eclass/check-reqs.eclass +++ b/eclass/check-reqs.eclass @@ -1,4 +1,4 @@ -# Copyright 1999-2017 Gentoo Foundation +# Copyright 1999-2018 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # @ECLASS: check-reqs.eclass @@ -39,8 +39,6 @@ if [[ ! ${_CHECK_REQS_ECLASS_} ]]; then -inherit eutils - # @ECLASS-VARIABLE: CHECKREQS_MEMORY # @DEFAULT_UNSET # @DESCRIPTION: @@ -68,22 +66,11 @@ case "${EAPI:-0}" in *) die "EAPI=${EAPI} is not supported" ;; esac -# @FUNCTION: check_reqs -# @DESCRIPTION: # Obsolete function executing all the checks and printing out results check_reqs() { - debug-print-function ${FUNCNAME} "$@" - - [[ ${EAPI:-0} == [012345] ]] || die "${FUNCNAME} is banned in EAPI > 5" - - echo - eqawarn "Package calling old ${FUNCNAME} function." - eqawarn "Please file a bug against the package." - eqawarn "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup" - eqawarn "and possibly use EAPI=4 or later." - echo - - check-reqs_pkg_setup "$@" + eerror "Package calling old ${FUNCNAME} function." + eerror "It should call check-reqs_pkg_pretend and check-reqs_pkg_setup." + die "${FUNCNAME} is banned" } # @FUNCTION: check-reqs_pkg_setup @@ -176,10 +163,9 @@ check-reqs_get_kibibytes() { local size=${1%[GMT]} case ${unit} in - G) echo $((1024 * 1024 * size)) ;; M) echo $((1024 * size)) ;; + G) echo $((1024 * 1024 * size)) ;; T) echo $((1024 * 1024 * 1024 * size)) ;; - [0-9]) echo $((1024 * size)) ;; *) die "${FUNCNAME}: Unknown unit: ${unit}" ;; @@ -196,17 +182,8 @@ check-reqs_get_number() { [[ -z ${1} ]] && die "Usage: ${FUNCNAME} [size]" - local unit=${1:(-1)} local size=${1%[GMT]} - local msg=eerror - [[ ${EAPI:-0} == [012345] ]] && msg=eqawarn - - # Check for unset units and warn about them. - # Backcompat. - if [[ ${size} == ${1} ]]; then - ${msg} "Package does not specify unit for the size check" - ${msg} "File bug against the package. It should specify the unit." - fi + [[ ${size} == ${1} ]] && die "${FUNCNAME}: Missing unit: ${1}" echo ${size} } @@ -224,8 +201,8 @@ check-reqs_get_unit() { local unit=${1:(-1)} case ${unit} in + M) echo "MiB" ;; G) echo "GiB" ;; - [M0-9]) echo "MiB" ;; T) echo "TiB" ;; *) die "${FUNCNAME}: Unknown unit: ${unit}" |