[PATCH util/modular] release.sh: Simplify checks for ACLOCAL, PKG_CONFIG_PATH, etc.

Alan Coopersmith alan.coopersmith at oracle.com
Wed May 12 16:08:14 PDT 2010


Peter Hutterer wrote:

> This is too obvious so I must be missing something here. Why's the old code
> that awkward?

I can't explain ACLOCAL, but for ones like this, it's not exactly equivalent:

>  # Set the path so that locally built apps will be found and used
> -if test x"$PATH" = x; then
> -    PATH=${DESTDIR}${PREFIX}/bin
> -else
> -    PATH=${DESTDIR}${PREFIX}/bin:${PATH}
> -fi
> +PATH=${DESTDIR}${PREFIX}/bin:${PATH}
>  export PATH
>  
>  # Choose which make program to use


In many of the : separated environment variables, especially $PATH
& $LD_LIBRARY_PATH, any sequence that resolves to an empty string
after : splitting may be resolved as the current directory on many
platforms, so the simplified code you propose is actually equivalent to:

 if test x"$PATH" = x; then
     PATH=${DESTDIR}${PREFIX}/bin:.
 else
     PATH=${DESTDIR}${PREFIX}/bin:${PATH}
 fi

i.e. appending the current directory to the path when it's unset.
(Though running with no $PATH seems unlikely, running with no
 $LD_LIBRARY_PATH is far more common.)

-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list