This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 3 of 9] scripts/functions: Use stat correctly on non-GNU (BSD/Darwin) systems


# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1274088386 -7200
# Node ID 155332452b994dbe6eb8ca86514829185dcb73bb
# Parent  8ac372981bd514ada27c564e69f64f228061a217
scripts/functions: Use stat correctly on non-GNU (BSD/Darwin) systems.

Call to get the directory mode depending on $CT_SYS_OS

diff -r 8ac372981bd5 -r 155332452b99 scripts/functions
--- a/scripts/functions	Mon May 17 11:22:37 2010 +0200
+++ b/scripts/functions	Mon May 17 11:26:26 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
+            GNU/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}"

--
For unsubscribe information see http://sourceware.org/lists.html#faq


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]