Bug#823194: grep-excuses: return failure on network errors

James McCoy jamessan at debian.org
Mon May 2 23:32:29 UTC 2016


On Mon, May 02, 2016 at 12:23:37PM +0800, Paul Wise wrote:
> I'm running grep-excuses from cron and diffing the results. When
> network is down, grep-excuses can't access anything and I end up
> diffing the usual results with an error message because the error is
> printed but the command doesn't return an error.
> 
> I would like grep-excuses to return failure when there is a failure.
> 
> These are the error messages I get when there is no network:
> 
> grep-excuses: fetch https://udd.debian.org/cgi-bin/autoremovals.cgi failed (4 )
> 
> gzip: stdin: unexpected end of file
> grep-excuses: read/zcat failed: 

In #816723, it was requested to not fail if the autoremovals listing
isn't available since that's extra information (reasons why something
might be removed from testing, not why it isn't entering testing).
That's the first message you see, and I agree with making that
non-fatal.

Then there's the actual fetching of update_excuses, which does error if
it fails.  The “grep-excuses: read/zcat failed” line is part of a die
statement, which is supposed to make Perl exit with a non-zero exit
code.

In my testing, it does indeed exit with a non-zero exit code (1 to be
exact).  I'm therefore not sure why you're not seeing such a failure.
That particular die statement has been in the code since it was first
added to devscripts in 2004.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <jamessan at debian.org>



More information about the devscripts-devel mailing list