diff options
author | Alexey Neyman <stilor@att.net> | 2017-02-12 14:23:16 -0800 |
---|---|---|
committer | Alexey Neyman <stilor@att.net> | 2017-02-12 22:02:28 -0800 |
commit | f9bec4ed7c4540de73c82c94053f975c5c7c29e4 (patch) | |
tree | 3d9e2a73ebca96ed9bd5a616658e018ecefc4920 /scripts/functions | |
parent | 41ba1d99c8801cf27bf59daf3663eee89156afa0 (diff) | |
download | crosstool-ng-f9bec4ed7c4540de73c82c94053f975c5c7c29e4.tar.gz crosstool-ng-f9bec4ed7c4540de73c82c94053f975c5c7c29e4.tar.bz2 crosstool-ng-f9bec4ed7c4540de73c82c94053f975c5c7c29e4.zip |
stat: determine whether it is BSD or GNU flavor
Seems like MacOS may have either in the path.
Signed-off-by: Alexey Neyman <stilor@att.net>
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/functions b/scripts/functions index 65ce4981..84054d58 100644 --- a/scripts/functions +++ b/scripts/functions @@ -567,15 +567,15 @@ CT_DoForceRmdir() { local mode for dir in "${@}"; do [ -d "${dir}" ] || continue - case "$CT_SYS_OS" in - Linux|CYGWIN*) + case "${CT_CONFIGURE_has_stat_flavor_GNU},${CT_CONFIGURE_has_stat_flavor_BSD}" in + y,*) mode="$(stat -c '%a' "$(dirname "${dir}")")" ;; - Darwin|*BSD) + *,y) mode="$(stat -f '%Lp' "$(dirname "${dir}")")" ;; *) - CT_Abort "Unhandled host OS $CT_SYS_OS" + CT_Abort "Unknown stat format options" ;; esac CT_DoExecLog ALL chmod u+w "$(dirname "${dir}")" |