[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Another testsuite nit: `set -'
From: |
Paul Eggert |
Subject: |
Re: Another testsuite nit: `set -' |
Date: |
Fri, 29 Apr 2005 14:51:48 -0700 |
User-agent: |
Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) |
address@hidden (Eric Blake) writes:
> The testsuite had several uses of `set - $list', such that $list
> could safely begin with `-'. But 1) POSIX has obsoleted this usage,
> The other portability fix is that on cygwin, mkdir(2) executed from
> a directory that has ACLs propagates ACLs to the new directory (as a
> byproduct of how Windows NTFS permissions are mapped to POSIX
> semantics).
Thanks for catching these. I installed the following
somewhat-different patch:
2005-04-29 Paul Eggert <address@hidden>
The following was partly derived from a tiny change by Eric Blake:
* tests/misc/nice: Don't use 'set -'. It's not portable to strict
POSIX 1003.1-2001 hosts. Also, don't set _POSIX2_VERSION.
* tests/mkdir/perm: Don't use 'set -'. Simplify test construction.
Work even if the underyling system attaches ACLs to new dirs.
* tests/mv/part-hardlink: Don't use 'set -'.
* tests/stty/row-col-1: Don't use 'set -'.
Index: tests/misc/nice
===================================================================
RCS file: /fetish/cu/tests/misc/nice,v
retrieving revision 1.2
diff -p -u -r1.2 nice
--- tests/misc/nice 14 May 2003 06:26:52 -0000 1.2
+++ tests/misc/nice 29 Apr 2005 21:45:39 -0000
@@ -29,16 +29,13 @@ tests='
19 --1:-12 12
NA LAST NA
'
-set - $tests
+set $tests
if test "$VERBOSE" = yes; then
nice --version
set -x
fi
-_POSIX2_VERSION=199209
-export _POSIX2_VERSION
-
# Require that this test be run at `nice' level 0.
niceness=`nice`
if test "$niceness" = 0; then
Index: tests/mkdir/perm
===================================================================
RCS file: /fetish/cu/tests/mkdir/perm,v
retrieving revision 1.16
diff -p -u -r1.16 perm
--- tests/mkdir/perm 22 Apr 2005 23:54:05 -0000 1.16
+++ tests/mkdir/perm 29 Apr 2005 21:45:39 -0000
@@ -44,12 +44,14 @@ tests='
027 : -m =+x : drwxr-x--- : d--x--x--- :
- : - : last : last :
'
+colon_tests=`echo $tests | sed 's/^ *//; s/ *: */:/g'`
+
for p in empty -p; do
test _$p = _empty && p=
old_IFS=$IFS
IFS=':'
- set - `(echo "$tests"|tr -d '\n'; echo)|sed 's/^ *//;s/ *:/:/g;s/: */:/g'`
+ set $colon_tests
IFS=$old_IFS
while :; do
@@ -71,11 +73,11 @@ for p in empty -p; do
mkdir $p $mode parent/sub || fail=1
- perms=`ls -ld parent | sed 's/ .*//'`
+ perms=`ls -ld parent | sed 's/ .*//; s/+$//'`
test "$parent_perms" = "$perms" \
|| { fail=1; echo parent: expected $parent_perms, got $perms; }
- perms=`ls -ld parent/sub | sed 's/ .*//'`
+ perms=`ls -ld parent/sub | sed 's/ .*//; s/+$//'`
test "$sub_perms" = "$perms" \
|| { fail=1; echo parent/sub: expected $sub_perms, got $perms; }
Index: tests/mv/part-hardlink
===================================================================
RCS file: /fetish/cu/tests/mv/part-hardlink,v
retrieving revision 1.2
diff -p -u -r1.2 part-hardlink
--- tests/mv/part-hardlink 23 Jun 2004 15:07:04 -0000 1.2
+++ tests/mv/part-hardlink 29 Apr 2005 21:45:39 -0000
@@ -42,9 +42,9 @@ mv f g $other_partition_tmpdir || fail=1
mv a b $other_partition_tmpdir || fail=1
cd $other_partition_tmpdir
-set - `ls -Ci f g`
+set `ls -Ci f g`
test $1 = $3 || fail=1
-set - `ls -Ci a/1 b/1`
+set `ls -Ci a/1 b/1`
test $1 = $3 || fail=1
(exit $fail); exit $fail
Index: tests/stty/row-col-1
===================================================================
RCS file: /fetish/cu/tests/stty/row-col-1,v
retrieving revision 1.10
diff -p -u -r1.10 row-col-1
--- tests/stty/row-col-1 3 Jan 2005 21:25:13 -0000 1.10
+++ tests/stty/row-col-1 29 Apr 2005 21:45:39 -0000
@@ -36,7 +36,7 @@ tests='
9 rows_30 30_80
NA LAST NA
'
-set - $tests
+set $tests
saved_size=.saved-size
- Re: Another testsuite nit: `set -',
Paul Eggert <=