diff options
-rwxr-xr-x | scripts/bootstrap-prefix.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/bootstrap-prefix.sh b/scripts/bootstrap-prefix.sh index 3a9dd3cb87..313139c0e8 100755 --- a/scripts/bootstrap-prefix.sh +++ b/scripts/bootstrap-prefix.sh @@ -2687,8 +2687,15 @@ EOF EPREFIX= continue fi - if [[ $(stat -c '%U/%G' "${EPREFIX}"/.canihaswrite) != \ - $(stat -c '%U/%G' "${EPREFIX}") ]] ; + # GNU and BSD variants of stat take different arguments (and + # format specifiers are not equivalent) + case "${CHOST}" in + *-darwin* | *-freebsd*) STAT='stat -f %u/%g' ;; + *) STAT='stat -c %U/%G' ;; + esac + + if [[ $(${STAT} "${EPREFIX}"/.canihaswrite) != \ + $(${STAT} "${EPREFIX}") ]] ; then echo echo "The $EPREFIX directory has different ownership than expected." |