On Mon, 13 Jun 2005, Richard Levitte via RT wrote:
> [EMAIL PROTECTED] - Sun Jun 12 03:21:44 2005]:
>
> > On Mon, 6 Jun 2005, Richard Levitte via RT wrote:
> >
> > > Whatever the problem is, I do not agree with removing 'set -e'.
> > Setting
> > > -e ensures that an error that happens within a loop is propagated to
> > > become the error *of* the loop (or actually, the whole shell
> > session),
> > > which is therefore returned to make. Without 'set -e', errors may
> > > happen withing the loops or a series of commands with make not
> > knowing
> > > about it. Instead, make will only get the exit code from the last
> > > command executed.
> >
> >
> > I guess I just don't understand. I don't see why it succeeds on any
> > platform. The "set -e" fails if an exit code is anything other than
> > "0". Installing the manual pages involves calling grep with arguments
> > known to succeed at times and fail at times, sometimes giving exit
> > code of "0" and sometimes of "1". That seems to be why "set -e" stops
> > the loop. For example:
>
> Aha, *that's* what we need to debug then.
>
> BTW, the exit code of a pipe is usually the exit code of the last
> command in the chain. So you can't really blame grep, since their
> result is piped into a parenthesised complex command. I'm willing to be
> either 'read' or 'util/point.sh' return with an exit code other than 0,
> and that it could be enough to have an 'exit 0' at the end of the
> complex command (and maybe another 'set -e' before the while loop).
Testing various changes in Makefile reveals that the problem really
does seem to be the return code from grep. This is probably a bug in
the DJGPP implementation of "set -e" in bash, related to the fact that
DOS really doesn't have pipes. They are emulated via temporary files.
The DJGPP "set -e" seems to be sensitive to non-zero return codes
within the simulated pipe. The attached patch to Makefile.org works
for DJGPP. I think it shouldn't adversely affect other platforms.
Doug
--
Doug Kaufman
Internet: [EMAIL PROTECTED]
--- Makefile.org.ori 2005-06-06 00:52:32.000000000 -0800
+++ Makefile.org 2005-06-18 23:15:06.000000000 -0800
@@ -522,8 +522,8 @@
--release=$(VERSION) `basename $$i`") \
>
$(INSTALL_PREFIX)$(MANDIR)/man$$sec/$$fn.$${sec}$(MANSUFFIX); \
$(PERL) util/extract-names.pl < $$i | \
- grep -v $$filecase "^$$fn\$$" | \
- grep -v "[ ]" | \
+ (grep -v $$filecase "^$$fn\$$"; true) | \
+ (grep -v "[ ]"; true) | \
(cd $(INSTALL_PREFIX)$(MANDIR)/man$$sec/; \
while read n; do \
$$here/util/point.sh $$fn.$${sec}$(MANSUFFIX)
"$$n".$${sec}$(MANSUFFIX); \