I noticed this problem while building coreutils from CVS:

test "echo 'spy:;@echo $(all_programs)' | MAKEFLAGS= make -s -C ../src -f Makefile -f 
- spy | ../src/tr -s ' ' '\n' | LC_ALL=C sort -u | grep -v '\['" && : || exit 1
/bin/sh: all_programs: command not found

While fixing this, I also noticed that the test doesn't work if the
environment variable 'missing' happens to be set to 1, and that it
exits with nonzero status if $(programs) happens to output nothing
(I assume this was to avoid a shell syntax error in "for p in `$(programs)`"?
I used a dummy instead in the patch below.)

2003-11-05  Paul Eggert  <[EMAIL PROTECTED]>

        * man/Makefile.am (check-programs-vs-x):
        Work even if $(programs) contains '$'.
        Work even if 'missing=1' in environment.
        Don't report an error simply because $(programs) outputs nothing.

--- man/Makefile.am.~1.27.~     Wed Sep 10 02:26:56 2003
+++ man/Makefile.am     Wed Nov  5 23:41:46 2003
@@ -160,10 +160,11 @@ programs =                                                       
         \
 
 .PHONY: check-programs-vs-x
 check-programs-vs-x:
-       test "$(programs)" && : || exit 1
-       for p in `$(programs)`; do                      \
+       status=0;                                       \
+       for p in dummy `$(programs)`; do                \
+         test $$p = dummy && continue;                 \
          test $$p = ginstall && p=install || : ;       \
          test -f $(srcdir)/$$p.x                       \
-           || { echo missing $$p.x 1>&2; missing=1; }; \
+           || { echo missing $$p.x 1>&2; status=1; };  \
        done;                                           \
-       test "$$missing" = 1 && exit 1 || :
+       exit $$status


_______________________________________________
Bug-coreutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to