[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: test-init.sh failure on AIX 7.1
From: |
Bruno Haible |
Subject: |
Re: test-init.sh failure on AIX 7.1 |
Date: |
Sat, 28 Jan 2012 23:31:36 +0100 |
User-agent: |
KMail/4.7.4 (Linux/3.1.0-1.2-desktop; KDE/4.7.4; x86_64; ; ) |
Hi Jim,
Thanks for the quick review.
> > -if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null`; then
> > +if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
> > + && diff -u Makefile "$0" 2>/dev/null | grep '^.#!' >/dev/null; then
>
> Why use "." rather than a literal "+" there?
You're right, it's clearer if I use '^[+]#!' . And more reliable too,
in case the Makefile happens to contain a line that starts with #! .
(I was thinking at context diffs, which requires '^[+!]#!' .)
Pushed with that change.
Bruno
--- tests/init.sh.orig Sat Jan 28 23:28:58 2012
+++ tests/init.sh Sat Jan 28 23:23:39 2012
@@ -255,7 +255,10 @@
return 2
}
-if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null`; then
+if diff_out_=`exec 2>/dev/null; diff -u "$0" "$0" < /dev/null` \
+ && diff -u Makefile "$0" 2>/dev/null | grep '^[+]#!' >/dev/null; then
+ # diff accepts the -u option and does not (like AIX 7 'diff') produce an
+ # extra space on column 1 of every content line.
if test -z "$diff_out_"; then
compare_ () { diff -u "$@"; }
else
--- tests/test-init.sh.orig Sat Jan 28 23:28:58 2012
+++ tests/test-init.sh Sat Jan 28 20:34:02 2012
@@ -50,20 +50,19 @@
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac
compare empty in >out 2>err && fail=1
- # Remove the TAB-date suffix on each --- and +++ line,
- # for both the expected and the actual output files.
- # Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ:
- # -@@ -0,0 +1 @@
- # +@@ -1,0 +1,1 @@
- cat <<\EOF > exp
+ # Compare against expected output only if compare is using diff -u.
+ if grep @ out >/dev/null; then
+ # Remove the TAB-date suffix on each --- and +++ line,
+ # for both the expected and the actual output files.
+ # Also remove the @@ line, since Solaris 5.10 and GNU diff formats differ:
+ # -@@ -0,0 +1 @@
+ # +@@ -1,0 +1,1 @@
+ sed 's/ .*//;/^@@/d' out > k && mv k out
+ cat <<\EOF > exp
--- empty
+++ in
+xyz
EOF
- sed 's/ .*//;/^@@/d' out > k && mv k out
-
- # Compare against expected output only if compare is using diff -u.
- if diff -u out out < /dev/null > /dev/null 2>&1; then
compare exp out || fail=1
fi
case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac