bug-tar
[Top][All Lists]
Advanced

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

[Bug-tar] [PATCH] tar: don't use "((" in shell scripts


From: Paul Eggert
Subject: [Bug-tar] [PATCH] tar: don't use "((" in shell scripts
Date: Tue, 26 Oct 2010 15:17:16 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.14) Gecko/20101006 Thunderbird/3.0.9

I found a portability bug in a test case when I used CONFIG_SHELL=/bin/ksh
on Solaris 10.  I pushed the following obvious fix.

* tests/extrac11.at: Replace "((" with "( (" in shell scripts, as
"((" is not portable to the Korn shell, and POSIX 1003.1-2008 says
that "((" is not portable.
---
 tests/extrac11.at |   30 +++++++++++++++---------------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/tests/extrac11.at b/tests/extrac11.at
index f7ba587..979b77c 100644
--- a/tests/extrac11.at
+++ b/tests/extrac11.at
@@ -47,30 +47,30 @@ for dir in $dirs; do
 done
 
 # Check that "ulimit" itself works.
-((ulimit -n 100 &&
-  tar -cf archive1.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-  tar -xf archive1.tar -C dest1 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
- ) &&
- diff -r a dest1/a
+( (ulimit -n 100 &&
+   tar -cf archive1.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
+   tar -xf archive1.tar -C dest1 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
+  ) &&
+  diff -r a dest1/a
 ) >/dev/null 2>&1 ||
    AT_SKIP_TEST
 
 # Another test that "ulimit" itself works:
 # tar should fail when completely starved of file descriptors.
-((ulimit -n 4 &&
-  tar -cf archive2.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-  tar -xf archive2.tar -C dest2 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
- ) &&
- diff -r a dest2/a
+( (ulimit -n 4 &&
+   tar -cf archive2.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
+   tar -xf archive2.tar -C dest2 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
+  ) &&
+  diff -r a dest2/a
 ) >/dev/null 2>&1 &&
    AT_SKIP_TEST
 
 # Tar should work when there are few, but enough, file descriptors.
-((ulimit -n 10 &&
-  tar -cf archive3.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
-  tar -xf archive3.tar -C dest3 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
- ) &&
- diff -r a dest3/a >/dev/null 2>&1
+( (ulimit -n 10 &&
+   tar -cf archive3.tar a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&- &&
+   tar -xf archive3.tar -C dest3 a 3<&- 4<&- 5<&- 6<&- 7<&- 8<&- 9<&-
+  ) &&
+  diff -r a dest3/a >/dev/null 2>&1
 ) || { diff -r a dest3/a; exit 1; }
 ],
 [0],[],[],[],[],[gnu])
-- 
1.7.2




reply via email to

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