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 2 of 9] build/internals.sh: Replace nonportable call to stat


# HG changeset patch
# User Titus von Boxberg <titus@v9g.de>
# Date 1274088157 -7200
# Node ID 8ac372981bd514ada27c564e69f64f228061a217
# Parent  73ce2dbf95d6145f1878455846481e1b362a1caa
build/internals.sh: Replace nonportable call to stat

The call to stat to find out if a file is a symlink works only on GNU systems,
and the replacing portable call to readlink is also shorter and more concise code.

diff -r 73ce2dbf95d6 -r 8ac372981bd5 scripts/build/internals.sh
--- a/scripts/build/internals.sh	Mon May 17 10:30:18 2010 +0200
+++ b/scripts/build/internals.sh	Mon May 17 11:22:37 2010 +0200
@@ -68,7 +68,7 @@
         # scripts, we don't know if they would in the end spawn a binary...
         # Just skip symlinks
         for _t in "${CT_TARGET}-"*; do
-            if [ "$( LANG=C stat -c '%F' "${_t}" )" != "symbolic link" ]; then
+            if [ -z "`readlink ${_t}`" ]; then
                 CT_DoExecLog ALL mv "${_t}" ".${_t}"
                 CT_DoExecLog ALL ln ".${CT_TARGET}-wrapper" "${_t}"
             fi

--
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]