Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/prefix:master commit in: scripts/
Date: Sun, 25 Oct 2020 08:15:22
Message-Id: 1603613662.6b522acbb352eaae250d54b48456350ded50d7ce.grobian@gentoo
1 commit: 6b522acbb352eaae250d54b48456350ded50d7ce
2 Author: Alexander Bezrukov <phmagic <AT> mail <DOT> ru>
3 AuthorDate: Sun Oct 25 08:14:22 2020 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 25 08:14:22 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=6b522acb
7
8 scripts/bootstrap-prefix: fix stat invocation for Darwin/*BSD
9
10 Closes: https://bugs.gentoo.org/751037
11 Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
12
13 scripts/bootstrap-prefix.sh | 11 +++++++++--
14 1 file changed, 9 insertions(+), 2 deletions(-)
15
16 diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh
17 index 3a9dd3cb87..313139c0e8 100755
18 --- a/scripts/bootstrap-prefix.sh
19 +++ b/scripts/bootstrap-prefix.sh
20 @@ -2687,8 +2687,15 @@ EOF
21 EPREFIX=
22 continue
23 fi
24 - if [[ $(stat -c '%U/%G' "${EPREFIX}"/.canihaswrite) != \
25 - $(stat -c '%U/%G' "${EPREFIX}") ]] ;
26 + # GNU and BSD variants of stat take different arguments (and
27 + # format specifiers are not equivalent)
28 + case "${CHOST}" in
29 + *-darwin* | *-freebsd*) STAT='stat -f %u/%g' ;;
30 + *) STAT='stat -c %U/%G' ;;
31 + esac
32 +
33 + if [[ $(${STAT} "${EPREFIX}"/.canihaswrite) != \
34 + $(${STAT} "${EPREFIX}") ]] ;
35 then
36 echo
37 echo "The $EPREFIX directory has different ownership than expected."