check-reqs.eclass: Require units for CHECKREQS_ in EAPIs > 5
authorJustin Lecher <jlec@gentoo.org>
Sun, 27 Dec 2015 10:24:10 +0000 (11:24 +0100)
committerJustin Lecher <jlec@gentoo.org>
Sat, 2 Jan 2016 10:41:26 +0000 (11:41 +0100)
Signed-off-by: Justin Lecher <jlec@gentoo.org>
eclass/check-reqs.eclass

index 0b66f5459ef8043347758556af03cc81cb38b45a..793a7308c39ba37f2748024c11b800ef9f75545a 100644 (file)
@@ -199,13 +199,14 @@ check-reqs_get_number() {
 
        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
-               eqawarn "Package does not specify unit for the size check"
-               eqawarn "Assuming mebibytes."
-               eqawarn "File bug against the package. It should specify the unit."
+               ${msg} "Package does not specify unit for the size check"
+               ${msg} "File bug against the package. It should specify the unit."
        fi
 
        echo ${size}