bug-cpio
[Top][All Lists]
Advanced

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

[Bug-cpio] cpio 2.12: symlink-long test portability fix


From: Christian Weisgerber
Subject: [Bug-cpio] cpio 2.12: symlink-long test portability fix
Date: Wed, 16 Sep 2015 22:28:18 +0200
User-agent: Mutt/1.5.24 (2015-08-30)

There's a portability issue in the symlink-long regression test
added to cpio 2.12.

The {n..m} range construct is a recent invention of ksh93 and bash.
Here's a replacement with standard shell syntax.  I picked expr(1)
over POSIX shell arithmetic for maximum portability.

The seq(1) command is not standard either, just to forestall
suggestions in that direction.

--- tests/symlink-long.at.orig  Sat Sep 12 12:57:30 2015
+++ tests/symlink-long.at       Wed Sep 16 22:12:00 2015
@@ -27,9 +27,11 @@ AT_CHECK([
 
 # len(dirname) > READBUFSIZE
 dirname=
-for i in {1..52}; do
+i=1
+while test $i -le 52; do
     dirname="xxxxxxxxx/$dirname"
     mkdir "$dirname"
+    i=`expr $i + 1`
 done
 ln -s "$dirname" x || AT_SKIP_TEST
 
-- 
Christian "naddy" Weisgerber                          address@hidden



reply via email to

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