diff options
author | Titus von Boxberg <titus@v9g.de> | 2010-05-19 18:22:32 +0200 |
---|---|---|
committer | Titus von Boxberg <titus@v9g.de> | 2010-05-19 18:22:32 +0200 |
commit | 47af4ebf455b5a586d96c23f3ebd8a6a756ed040 (patch) | |
tree | e2417cbaad8ca25c77a52fd896b48fa0a4374890 /scripts/functions | |
parent | 91381251a039e3cc2df3fa8bde2dcbe4f5cbafd7 (diff) | |
download | crosstool-ng-47af4ebf455b5a586d96c23f3ebd8a6a756ed040.tar.gz crosstool-ng-47af4ebf455b5a586d96c23f3ebd8a6a756ed040.tar.bz2 crosstool-ng-47af4ebf455b5a586d96c23f3ebd8a6a756ed040.zip |
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/'.
Diffstat (limited to 'scripts/functions')
-rw-r--r-- | scripts/functions | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/functions b/scripts/functions index e991a189..a4e8cd07 100644 --- a/scripts/functions +++ b/scripts/functions @@ -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}" |