mirror of
https://github.com/crosstool-ng/crosstool-ng.git
synced 2025-01-18 10:46:26 +00:00
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/'.
This commit is contained in:
parent
91381251a0
commit
47af4ebf45
@ -252,7 +252,17 @@ CT_DoForceRmdir() {
|
||||
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}"
|
||||
|
Loading…
Reference in New Issue
Block a user