Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o, Justin Lecher <jlec@g.o>
Cc: qa@g.o, Justin Lecher <jlec@g.o>
Subject: Re: [gentoo-dev] [PATCH 5/9] check-reqs.eclass: Replace obsolete df option -m with -B ###
Date: Mon, 28 Dec 2015 14:24:38
Message-Id: AB323AA2-53C0-42B8-B340-E2695E74AEAC@gentoo.org
In Reply to: [gentoo-dev] [PATCH 5/9] check-reqs.eclass: Replace obsolete df option -m with -B ### by Justin Lecher
1 Dnia 28 grudnia 2015 09:43:51 CET, Justin Lecher <jlec@g.o> napisał(a):
2 >Signed-off-by: Justin Lecher <jlec@g.o>
3 >---
4 > eclass/check-reqs.eclass | 2 +-
5 > 1 file changed, 1 insertion(+), 1 deletion(-)
6 >
7 >diff --git a/eclass/check-reqs.eclass b/eclass/check-reqs.eclass
8 >index 138bfec..a32f8f8 100644
9 >--- a/eclass/check-reqs.eclass
10 >+++ b/eclass/check-reqs.eclass
11 >@@ -306,7 +306,7 @@ check-reqs_disk() {
12 > ${size} \
13 > "disk space at \"${path}\""
14 >
15 >- space_megs=$(df -Pm "${1}" 2>/dev/null | awk 'FNR == 2 {print $4}')
16 >+ space_megs=$(df -P -B 1048576 "${1}" 2>/dev/null | awk 'FNR == 2
17 >{print $4}')
18
19 I don't want to spoil the party but '-B' doesn't seem portable. I don't see that option in FreeBSD man page.
20
21 >
22 > if [[ $? == 0 && -n ${space_megs} ]] ; then
23 > if [[ ${space_megs} -lt $(check-reqs_get_mebibytes ${size}) ]] ; then
24
25
26 --
27 Best regards,
28 Michał Górny (by phone)

Replies