Akim Demaille <[EMAIL PROTECTED]> wrote:
| >>>>> "Jim" == Jim Meyering <[EMAIL PROTECTED]> writes:
|
| Jim> I vaguely recall that we couldn't depend on touch. However, it
| Jim> *is* in the list of programs mentioned in standards.info's
| Jim> `Utilities in Makefiles' section.
|
| Anyway, we really need to know how to create portably empty files, we
| use it at other places IIRC.
|
| Jim> | or
| Jim> |
| Jim> | cp /dev/null empty
|
| Jim> Not everyone has a /dev/null.
|
| Huh??? What for instance?
Er... Well, I guess you've caught me :-)
I can't name one offhand. And even if I could, it probably
wouldn't be worth making a change.
Thanks :-)
| But anyway, /dev/null is *widespread* in Autoconf, so we shouldn't
| bother.
I agree. (so maybe I shouldn't have mentioned that it's not always available :-)
| Here is my proposal:
Looks good.
| Index: tests/atgeneral.m4
| ===================================================================
| RCS file: /cvs/autoconf/tests/atgeneral.m4,v
| retrieving revision 1.61
| diff -u -u -r1.61 atgeneral.m4
| --- tests/atgeneral.m4 2001/03/13 12:43:15 1.61
| +++ tests/atgeneral.m4 2001/03/19 10:11:00
| @@ -187,9 +187,16 @@
| # Tests to run.
| test -z "$at_tests" && at_tests=$at_tests_all
|
| +# Can we diff with `/dev/null'? DU 5.0 refuses.
| +if diff /dev/null /dev/null >/dev/null 2>&1; then
| + at_devnull='/dev/null'
| +else
| + cp /dev/null at-devnull
| + at_devnull='at-devnull'
This is just nit-picking, but...
how about factoring out that extra use of `at-devnull'
and removing all the useless single quotes?
if diff /dev/null /dev/null >/dev/null 2>&1; then
at_devnull=/dev/null
else
at_devnull=at-devnull
cp /dev/null $at_devnull
fi
| +fi
| +
| # Use `diff -u' when possible.
| -: >empty
| -if diff -u empty empty >/dev/null 2>&1; then
| +if diff $at_devnull $at_devnull >/dev/null 2>&1; then
| at_diff='diff -u'
| else
| at_diff='diff'
| @@ -531,14 +538,14 @@
| stderr, [(echo stderr:; tee stderr <at-stderr) >&5],
| ignore, [(echo stderr:; cat at-stderr) >&5],
| experr, [$at_diff experr at-stderr >&5 || at_failed=:],
| - [], [$at_diff empty at-stderr >&5 || at_failed=:],
| + [], [$at_diff $at_devnull at-stderr >&5 || at_failed=:],
| [echo $at_n "AS_ESCAPE([$4])$at_c" | $at_diff - at-stderr >&5 ||
|at_failed=:])
| dnl Check stdout.
| m4_case([$3],
| stdout, [(echo stdout:; tee stdout <at-stdout) >&5],
| ignore, [(echo stdout:; cat at-stdout) >&5],
| expout, [$at_diff expout at-stdout >&5 || at_failed=:],
| - [], [$at_diff empty at-stdout >&5 || at_failed=:],
| + [], [$at_diff $at_devnull at-stdout >&5 || at_failed=:],
| [echo $at_n "AS_ESCAPE([$3])$at_c" | $at_diff - at-stdout >&5 ||
|at_failed=:])
| dnl Check exit val. Don't `skip' if we are precisely checking $? = 77.
| case $at_status in