Re: /bzr/squid3/trunk/ r10399: Back out the tweak on rev10398.

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Thu, 22 Apr 2010 17:13:24 +1200

Henrik Nordstrom wrote:
> mån 2010-04-19 klockan 23:25 +0000 skrev Amos Jeffries:
>
>>>> - $(AWK) -f $(srcdir)/mk-globals-c.awk < $(srcdir)/globals.h > $@ ||
>>>> $(RM) -f $@ && exit 1
>>>> + $(AWK) -f $(srcdir)/mk-globals-c.awk < $(srcdir)/globals.h > $@ ||
>>>> $(RM) -f $@
>>> Why?
>>>
>> I had bound the exit(1) to success of the rm command, not failure of the
>> awk. When we get time to sort out the shell nesting of automake it needs to
>> be added back in to ensure the make runs exit on awk failure.
>
> Sure you had.
>
> awk ok -> SUCCESS
> awk fail -> rm
> rm fail -> FAILURE
> rm ok -> exit 1 == FAILURE
>
> exit in this context is just to make the shell command return an error
> so make stops. rm failing is in itself an error and no explicit exit
> with an error is needed in that case. If you absolutely want exit to be
> called in both cases then group rm & exit
>
> $(AWK) -f $(srcdir)/mk-globals-c.awk < $(srcdir)/globals.h > $@ || ($(RM) -f $@ ;exit 1)
>
> but I prefer your original
>
> $(AWK) -f $(srcdir)/mk-globals-c.awk < $(srcdir)/globals.h > $@ || $(RM) -f $@ && exit 1
>
> the effect of both is the same, and your original is both clearer and more efficient.
>
> Regards
> Henrik
>

Thanks for confirming my initial logic.

What hudson was showing was build always exiting at the first of these
files. Even in the "awk ok -> SUCCESS" case. That needs to be figured
out before "&& exit 1" can go back on.

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.1
Received on Thu Apr 22 2010 - 05:13:32 MDT

This archive was generated by hypermail 2.2.0 : Fri Apr 23 2010 - 12:00:09 MDT