diff -ur a/bootstrap-prefix.sh b/bootstrap-prefix.sh --- a/bootstrap-prefix.sh 2020-10-24 15:50:24.266777899 +0300 +++ b/bootstrap-prefix.sh 2020-10-24 16:57:07.864168126 +0300 @@ -2687,8 +2687,14 @@ 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."