libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fix testsuite errors due to shell quoted parameter expansion issue.


From: Ralf Wildenhues
Subject: Fix testsuite errors due to shell quoted parameter expansion issue.
Date: Tue, 3 Aug 2010 22:32:04 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

Interesting shell unportability:

$ bash -c 'f=" val" e=; echo "$e"$f'
val
$ ksh -c 'f=" val" e=; echo "$e"$f'
 val

ksh93, dash, zsh all do it like ksh.  Is that a bug in bash?

Anyway, the patch below seems to fix it, but I may want to fix the log
entry to pinpoing the culprit correctly.

Thanks,
Ralf

    Fix testsuite errors due to shell quoted parameter expansion issue.
    
    * tests/getopt-m4sh.at (_LT_AT_GETOPT_M4SH_SETUP): Insert space
    between double-quoted and unquoted shell parameter, as ksh may
    add one in its output anyway if the expansion of the second one
    starts with a space.
    (short option splitting, enhanced shell short option splitting)
    (long option splitting, XSI long option splitting): Add space in
    expected output.
    Fixes testsuite failures on AIX, FreeBSD, etc.

diff --git a/tests/getopt-m4sh.at b/tests/getopt-m4sh.at
index ca5d5b8..768d595 100644
--- a/tests/getopt-m4sh.at
+++ b/tests/getopt-m4sh.at
@@ -44,7 +44,7 @@ M4SH_GETOPTS(
   [i], [--install],    [],     [options="$options install"],
   [v], [--verbose],    [],     [options="$options verbose"],
   [!], [--ltdl],       [false],[options="$options ltdl=$optarg"],
-[echo "$list"$options])
+[echo "$list" $options])
 ]])
 m4_pattern_forbid([m4_include])
 m4_pattern_forbid([AS_INIT])
@@ -87,7 +87,7 @@ rm -f options && mv options.tmp options])
 AT_SETUP([short option splitting])
 
 AT_DATA(expout,
-[[force verbose install
+[[ force verbose install
 ]])
 
 _LT_AT_GETOPT_M4SH_SETUP
@@ -103,7 +103,7 @@ AT_SETUP([enhanced shell short option splitting])
 AT_CHECK([fgrep '# Extended-shell func_split_short_opt' 
$abs_top_builddir/libtool >/dev/null 2>&1 || (exit 77)])
 
 AT_DATA(expout,
-[[force verbose install
+[[ force verbose install
 ]])
 
 _LT_AT_GETOPT_M4SH_SETUP
@@ -121,7 +121,7 @@ AT_CLEANUP
 AT_SETUP([long option splitting])
 
 AT_DATA(expout,
-[[ltdl=long
+[[ ltdl=long
 ]])
 
 _LT_AT_GETOPT_M4SH_SETUP
@@ -137,7 +137,7 @@ AT_SETUP([XSI long option splitting])
 AT_CHECK([fgrep '# Extended-shell func_split_long_opt' 
$abs_top_builddir/libtool >/dev/null 2>&1 || (exit 77)])
 
 AT_DATA(expout,
-[[ltdl=long
+[[ ltdl=long
 ]])
 
 _LT_AT_GETOPT_M4SH_SETUP



reply via email to

[Prev in Thread] Current Thread [Next in Thread]