summaryrefslogtreecommitdiff
path: root/eclass/check-reqs.eclass
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-01-19 20:11:46 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-01-19 20:11:46 +0000
commit5b5df25227111ef465caf5c52bcfb66dac3219cd (patch)
tree31b713cac6188358125cbb66b8804030328740f0 /eclass/check-reqs.eclass
parent02e2208f46f4e2c00fb9743cbc47350bdd233bfa (diff)
gentoo resync : 19.01.2018
Diffstat (limited to 'eclass/check-reqs.eclass')
-rw-r--r--eclass/check-reqs.eclass37
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}"