summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2014-03-28 15:08:16 +0000
committerUlrich Müller <ulm@gentoo.org>2014-03-28 15:08:16 +0000
commit4bca375f0b598e3c37de508811ded71f76253406 (patch)
tree0f8621a50e7f3226c0bf90e4524f3a9857d7893b /eclass
parentFix sys-fs/eudev dependency for 1.5.3-r1 with multilib support. (diff)
downloadhistorical-4bca375f0b598e3c37de508811ded71f76253406.tar.gz
historical-4bca375f0b598e3c37de508811ded71f76253406.tar.bz2
historical-4bca375f0b598e3c37de508811ded71f76253406.zip
Output binary prefixes for units according to IEC 80000-13, as calculations are 1024 based. Fix documentation of check-reqs_get_unit function, and other minor fixes.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog7
-rw-r--r--eclass/check-reqs.eclass22
2 files changed, 17 insertions, 12 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 55eaa80eb6bc..98a941b50bbe 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1184 2014/03/26 13:12:39 kensington Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1185 2014/03/28 15:08:16 ulm Exp $
+
+ 28 Mar 2014; Ulrich Müller <ulm@gentoo.org> check-reqs.eclass:
+ Output binary prefixes for units according to IEC 80000-13, as calculations
+ are 1024 based. Fix documentation of check-reqs_get_unit function, and other
+ minor fixes.
26 Mar 2014; Michael Palimaka <kensington@gentoo.org> cmake-utils.eclass:
Fix typo in prefix block by Christoph Junghans <ottxor@gentoo.org>.
diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
index 0ad246e8dc45..87e8427b0e53 100644
--- a/eclass/check-reqs.eclass
+++ b/eclass/check-reqs.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/check-reqs.eclass,v 1.13 2012/10/19 03:35:15 patrick Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/check-reqs.eclass,v 1.14 2014/03/28 15:08:16 ulm Exp $
# @ECLASS: check-reqs.eclass
# @MAINTAINER:
@@ -155,7 +155,7 @@ check-reqs_run() {
# @FUNCTION: check-reqs_get_mebibytes
# @DESCRIPTION:
# Internal function that returns number in mebibytes.
-# Converts from 1G=1024 or 1T=1048576
+# Returns 1024 for 1G or 1048576 for 1T.
check-reqs_get_mebibytes() {
debug-print-function ${FUNCNAME} "$@"
@@ -176,8 +176,8 @@ check-reqs_get_mebibytes() {
# @FUNCTION: check-reqs_get_number
# @DESCRIPTION:
-# Internal function that returns number without the unit.
-# Converts from 1G=1 or 150T=150.
+# 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} "$@"
@@ -190,7 +190,7 @@ check-reqs_get_number() {
# Backcompat.
if [[ ${size} == ${1} ]]; then
ewarn "QA: Package does not specify unit for the size check"
- ewarn "QA: Assuming megabytes."
+ ewarn "QA: Assuming mebibytes."
ewarn "QA: File bug against the package. It should specify the unit."
fi
@@ -199,8 +199,8 @@ check-reqs_get_number() {
# @FUNCTION: check-reqs_get_unit
# @DESCRIPTION:
-# Internal function that returns number without the unit.
-# Converts from 1G=1 or 150T=150.
+# Internal function that return the unit without the numerical value.
+# Returns "GiB" for "1G" or "TiB" for "150T".
check-reqs_get_unit() {
debug-print-function ${FUNCNAME} "$@"
@@ -209,9 +209,9 @@ check-reqs_get_unit() {
local unit=${1:(-1)}
case ${unit} in
- G) echo "gigabytes" ;;
- [M0-9]) echo "megabytes" ;;
- T) echo "terabytes" ;;
+ G) echo "GiB" ;;
+ [M0-9]) echo "MiB" ;;
+ T) echo "TiB" ;;
*)
die "${FUNCNAME}: Unknown unit: ${unit}"
;;