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

[patches] PATCH: Remove bashisms from test



The shell script nptl/tst-tls6.sh uses {braces} for cross products,
which is not available in POSIX.

ChangeLog.eglibc:
2007-07-26  Jim Blandy  <jimb@xxxxxxxxxxxxxxxx>

	* nptl/tst-tls6.sh: Remove bashisms.

Index: nptl/tst-tls6.sh
===================================================================
--- nptl/tst-tls6.sh	(revision 2946)
+++ nptl/tst-tls6.sh	(revision 2947)
@@ -21,36 +21,44 @@
 > $logfile
 fail=0
 
+preloads () {
+    l=''
+    for s in "$@"; do
+        l="$l ${common_objpfx}nptl/tst-tls5mod$s.so"
+    done
+    echo $l | sed 's/:$//;s/: /:/g'
+}
+
 for aligned in a e f; do
   echo "preload tst-tls5mod{$aligned,b,c,d}.so" >> $logfile
   echo "===============" >> $logfile
-  EGLIBC_TEST_LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{$aligned,b,c,d}.so \
-	      | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
+  EGLIBC_TEST_LD_PRELOAD=`preloads $aligned b c d` \
+	      ${tst_tls5} >> $logfile || fail=1
   echo >> $logfile
 
   echo "preload tst-tls5mod{b,$aligned,c,d}.so" >> $logfile
   echo "===============" >> $logfile
-  EGLIBC_TEST_LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{b,$aligned,c,d}.so \
-	      | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
+  EGLIBC_TEST_LD_PRELOAD=`preloads b $aligned c d` \
+	      ${tst_tls5} >> $logfile || fail=1
   echo >> $logfile
 
   echo "preload tst-tls5mod{b,c,d,$aligned}.so" >> $logfile
   echo "===============" >> $logfile
-  EGLIBC_TEST_LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{b,c,d,$aligned}.so \
-	      | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
+  EGLIBC_TEST_LD_PRELOAD=`preloads b c d $aligned` \
+	      ${tst_tls5} >> $logfile || fail=1
   echo >> $logfile
 done
 
 echo "preload tst-tls5mod{d,a,b,c,e}" >> $logfile
 echo "===============" >> $logfile
-EGLIBC_TEST_LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,c,e}.so \
-	    | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
+EGLIBC_TEST_LD_PRELOAD=`preloads d a b c e` \
+	    ${tst_tls5} >> $logfile || fail=1
 echo >> $logfile
 
 echo "preload tst-tls5mod{d,a,b,e,f}" >> $logfile
 echo "===============" >> $logfile
-EGLIBC_TEST_LD_PRELOAD=`echo ${common_objpfx}nptl/tst-tls5mod{d,a,b,e,f}.so \
-	    | sed 's/:$//;s/: /:/g'` ${tst_tls5} >> $logfile || fail=1
+EGLIBC_TEST_LD_PRELOAD=`preloads d a b e f` \
+	    ${tst_tls5} >> $logfile || fail=1
 echo >> $logfile
 
 exit $fail