[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1637826 - /subversion/trunk/autogen.sh

From: Ben Reser <ben_at_reser.org>
Date: Tue, 02 Dec 2014 14:51:04 -0800

On 11/10/14 4:28 AM, brane_at_apache.org wrote:
> ltpath="`dirname $libtoolize`"
> -ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/libtool.m4}
> +ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`}/libtool.m4
>
> if [ ! -f $ltfile ]; then
> echo "$ltfile not found (try setting the LIBTOOL_M4 environment variable)"
> @@ -92,7 +92,7 @@ for file in ltoptions.m4 ltsugar.m4 ltve
> rm -f build/$file
>
> if [ $lt_major_version -ge 2 ]; then
> - ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`/$file}
> + ltfile=${LIBTOOL_M4-`cd $ltpath/../share/aclocal ; pwd`}/$file
>
> if [ ! -f $ltfile ]; then
> echo "$ltfile not found (try setting the LIBTOOL_M4 environment variable)"
> @@ -106,7 +106,7 @@ done
>
> if [ $lt_major_version -ge 2 ]; then
> for file in config.guess config.sub; do
> - configfile=${LIBTOOL_CONFIG-`cd $ltpath/../share/libtool/config ; pwd`/$file}
> + configfile=${LIBTOOL_CONFIG-`cd $ltpath/../share/libtool/config ; pwd`}/$file
>
> if [ ! -f $configfile ]; then
> echo "$configfile not found (try setting the LIBTOOL_CONFIG environment variable)"

I know this isn't new to this particular change, but shouldn't these parameter
substitutions with defaults be using :- instead of just -? Because if you set
the variables to null then it'll be looking for these files in the root path.

Consider the following examples:

[[[
variable=
# variable has been declared, but is set to null.

echo "${variable-0}" # (no output)
echo "${variable:-1}" # 1
# ^

unset variable

echo "${variable-2}" # 2
echo "${variable:-3}" # 3
]]]

Seems to me the omission of the colon is a mistake here.
Received on 2014-12-02 23:52:03 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.