[PATCH] Use '[]' over 'test' throughout.

Jeremy Huddleston jeremyhu at apple.com
Tue Sep 14 14:17:59 PDT 2010


On Sep 14, 2010, at 04:29, Trevor Woerner wrote:

> diff --git a/build.sh b/build.sh
> index 25965fd..fa6a321 100755
> --- a/build.sh
> +++ b/build.sh
> @@ -33,7 +33,7 @@ setup_buildenv() {
>     export HOST_OS=`uname -s`
>     export HOST_CPU=`uname -m`
> 
> -    if test x$LIBDIR = x ; then
> +    if [ x$LIBDIR = x ]; then
> 	export LIBDIR=lib
>     fi

This one could use some "" protection:

+    if [ x"$LIBDIR" = x ]; then

> ...

>     LIB_FLAGS=
> -    if test x$LIBDIR != x ; then
> +    if [ x$LIBDIR != x ]; then
>         LIB_FLAGS="--libdir=${PREFIX}/${LIBDIR}"
>     fi


ditto


> ...

> -if test -z "$LISTONLY" ; then
> +if [ -z "$LISTONLY" ]; then

So if we're going to use -z here, why are we using x"$SOMETHING" = x elsewhere ?





More information about the xorg-devel mailing list