bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

man/Makefile.am problem with `test "...$(all_programs)..."'


From: Paul Eggert
Subject: man/Makefile.am problem with `test "...$(all_programs)..."'
Date: 05 Nov 2003 23:47:05 -0800
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

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  <address@hidden>

        * 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]