scripts/functions: Use stat correctly on non-GNU (BSD/Darwin) systems.
Call to get the directory mode depending on $CT_SYS_OS
yann.morin.1998@anciens.enib.fr:
CT_SYS_OS has changed on Linuxsystem, it only gets the kernel name "Linux",
and not the system name, 'GNU/'.
1.1 --- a/scripts/functions Wed May 19 18:08:23 2010 +0200
1.2 +++ b/scripts/functions Wed May 19 18:22:32 2010 +0200
1.3 @@ -252,7 +252,17 @@
1.4 local mode
1.5 for dir in "${@}"; do
1.6 [ -d "${dir}" ] || continue
1.7 - mode="$(stat -c '%a' "$(dirname "${dir}")")"
1.8 + case "$CT_SYS_OS" in
1.9 + Linux)
1.10 + mode="$(stat -c '%a' "$(dirname "${dir}")")"
1.11 + ;;
1.12 + Darwin|*BSD)
1.13 + mode="$(stat -f '%Lp' "$(dirname "${dir}")")"
1.14 + ;;
1.15 + *)
1.16 + CT_Abort "Unhandled host OS $CT_SYS_OS"
1.17 + ;;
1.18 + esac
1.19 CT_DoExecLog ALL chmod u+w "$(dirname "${dir}")"
1.20 CT_DoExecLog ALL chmod -R u+w "${dir}"
1.21 CT_DoExecLog ALL rm -rf "${dir}"