+2016-03-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ Port better to Alpine Linux
+ Its diff implementation does not support -c, but does support -U3.
+ Problem reported by Assaf Gordon in: http://bugs.gnu.org/23107#13
+ * tests/init.sh (diff_opt_): New var.
+ (compare_): Prefer diff -U3 to diff -c to plain diff.
+
2016-03-24 Paul Eggert <eggert@cs.ucla.edu>
test-framework-sh: port to NetBSD 7.0
fi
}
fi
-elif diff_out_=`exec 2>/dev/null; diff -c "$0" "$0" < /dev/null`; then
+elif
+ for diff_opt_ in -U3 -c '' no; do
+ test "$diff_opt_" = no && break
+ diff_out_=`exec 2>/dev/null; diff $diff_opt_ "$0" "$0" </dev/null` && break
+ done
+ test "$diff_opt_" != no
+then
if test -z "$diff_out_"; then
- compare_ () { diff -c "$@"; }
+ compare_ () { diff $diff_opt_ "$@"; }
else
compare_ ()
{
- if diff -c "$@" > diff.out; then
+ if diff $diff_opt_ "$@" > diff.out; then
# No differences were found, but AIX and HP-UX 'diff' produce output
# "No differences encountered" or "There are no differences between the
# files.". Hide this output.