From f9bec4ed7c4540de73c82c94053f975c5c7c29e4 Mon Sep 17 00:00:00 2001 From: Alexey Neyman Date: Sun, 12 Feb 2017 14:23:16 -0800 Subject: stat: determine whether it is BSD or GNU flavor Seems like MacOS may have either in the path. Signed-off-by: Alexey Neyman --- scripts/functions | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'scripts/functions') 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}")" -- cgit v1.2.3