bug-automake
[Top][All Lists]
Advanced

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

Re: [includes patch] make distcheck hangs indefiniitely if a tool reads


From: Alexandre Duret-Lutz
Subject: Re: [includes patch] make distcheck hangs indefiniitely if a tool reads from stdin
Date: Sun, 21 Nov 2004 20:54:32 +0100
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

>>> "James" == James Youngman <address@hidden> writes:
[...]
 James> However, we have a bug, I think.  If a program fails to support --help
 James> or --version but instead wants to read data from stdin, "make
 James> distcheck" will hang forever.  GNU findutils comes with three such
 James> programs, which are used to build the locate database (they are not
 James> intended to be invoked directly by humans).  
[...]

Thanks.  I'm checking this in on HEAD and branch-1-9.

2004-11-21  Alexandre Duret-Lutz  <address@hidden>

        * lib/am/progs.am (installcheck-%DIR%PROGRAMS): Run programs with
        /dev/null as input, so we do not hang on programs that read their
        input without supporting --help and --version.
        * lib/am/scripts.am (installcheck-%DIR%SCRIPTS): Likewise for scripts.
        * tests/gnits2.test: Change scriptnok.sh to cat its input.
        Report and fix from James Youngman.

Index: lib/am/progs.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/progs.am,v
retrieving revision 1.44
diff -u -r1.44 progs.am
--- lib/am/progs.am     28 Jan 2004 20:50:43 -0000      1.44
+++ lib/am/progs.am     21 Nov 2004 19:48:52 -0000
@@ -120,7 +120,8 @@
 ## Insert the directory back if nobase_ is used.
 ?!BASE?          f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
          for opt in --help --version; do \
-           if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt > c$${pid}_.out 2> 
c$${pid}_.err \
+           if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \
+                2>c$${pid}_.err </dev/null \
                 && test -n "`cat c$${pid}_.out`" \
                 && test -z "`cat c$${pid}_.err`"; then :; \
            else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
Index: lib/am/scripts.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/scripts.am,v
retrieving revision 1.54
diff -u -r1.54 scripts.am
--- lib/am/scripts.am   28 Jan 2004 20:50:43 -0000      1.54
+++ lib/am/scripts.am   21 Nov 2004 19:48:52 -0000
@@ -110,7 +110,8 @@
 ## Insert the directory back if nobase_ is used.
 ?!BASE?          f=`echo "$$p" | sed 's|[^/]*$$||'`"$$f"; \
          for opt in --help --version; do \
-           if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt > c$${pid}_.out 2> 
c$${pid}_.err \
+           if "$(DESTDIR)$(%NDIR%dir)/$$f" $$opt >c$${pid}_.out \
+                2>c$${pid}_.err </dev/null \
                 && test -n "`cat c$${pid}_.out`" \
                 && test -z "`cat c$${pid}_.err`"; then :; \
            else echo "$$f does not support $$opt" 1>&2; bad=1; fi; \
Index: tests/gnits2.test
===================================================================
RCS file: /cvs/automake/automake/tests/gnits2.test,v
retrieving revision 1.8
diff -u -r1.8 gnits2.test
--- tests/gnits2.test   14 Nov 2003 21:25:58 -0000      1.8
+++ tests/gnits2.test   21 Nov 2004 19:48:52 -0000
@@ -1,5 +1,5 @@
 #! /bin/sh
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
+# Copyright (C) 2002, 2003, 2004  Free Software Foundation, Inc.
 #
 # This file is part of GNU Automake.
 #
@@ -71,9 +71,11 @@
 echo "Which version? Which usage?"
 EOF
 
+# Not only does this script not support --help/--version, but
+# it will also hang when run without input.
 cat >sub/scriptnok.sh <<EOF
 #!/bin/sh
-:
+cat
 EOF
 
 chmod +x sub/scriptok.sh

-- 
Alexandre Duret-Lutz





reply via email to

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