# HG changeset patch # User Titus von Boxberg # Date 1274286152 -7200 # Node ID 79de82f5843d2d78aa80a090eb286aa58804a600 # Parent 7d3e9e91dd9ac8511deceb15c5f5a01703d43b10 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/'. diff -r 7d3e9e91dd9a -r 79de82f5843d scripts/functions --- a/scripts/functions Wed May 19 18:08:23 2010 +0200 +++ b/scripts/functions Wed May 19 18:22:32 2010 +0200 @@ -252,7 +252,17 @@ local mode for dir in "${@}"; do [ -d "${dir}" ] || continue - mode="$(stat -c '%a' "$(dirname "${dir}")")" + case "$CT_SYS_OS" in + Linux) + mode="$(stat -c '%a' "$(dirname "${dir}")")" + ;; + Darwin|*BSD) + mode="$(stat -f '%Lp' "$(dirname "${dir}")")" + ;; + *) + CT_Abort "Unhandled host OS $CT_SYS_OS" + ;; + esac CT_DoExecLog ALL chmod u+w "$(dirname "${dir}")" CT_DoExecLog ALL chmod -R u+w "${dir}" CT_DoExecLog ALL rm -rf "${dir}"