[PATCH 2 of 9] build/internals.sh: Replace nonportable call to stat

Arnaud Lacombe lacombar@gmail.com
Tue May 18 20:40:00 GMT 2010


Hi,

On Mon, May 17, 2010 at 8:27 AM, Titus von Boxberg <titus@v9g.de> wrote:
> # 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
hum, test(1) tells me:

       -h FILE
              FILE exists and is a symbolic link (same as -L)
[...]

I think this is what is intended to be done, no ?

 - Arnaud

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



More information about the crossgcc mailing list