summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2018-01-12 10:23:34 +0100
committerUlrich Müller <ulm@gentoo.org>2018-01-19 10:15:29 +0100
commit39894a0f840c2984c4d9992dea1d656f4d6d1d75 (patch)
treec5cc6f8dbf0ce5a893061e30adbf9d4f162e4514 /eclass/check-reqs.eclass
parentnet-p2p/bisq: remove old version 0.6.2 (diff)
downloadgentoo-39894a0f840c2984c4d9992dea1d656f4d6d1d75.tar.gz
gentoo-39894a0f840c2984c4d9992dea1d656f4d6d1d75.tar.bz2
gentoo-39894a0f840c2984c4d9992dea1d656f4d6d1d75.zip
check-reqs.eclass: Make obsolete usage fatal.
QA warnings for calling the obsolete check_reqs function and for missing size units were in place for more than two years, and usage in the Gentoo repository has been fixed. Error out on all obsolete usage. This will also allow dropping the eutils inherit which was only needed for eqawarn().
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}"