On Sat, 2009-01-31 at 20:13 +0900, Paul Wise wrote:
> Please make rmadison give a sensible return value. Currently it only
> returns success, even when it couldn't contact the qa script. IMO the
> only of the following situations where it should return success is the
> second one. I think it should also differentiate between not being able
> to contact the server and not finding the requested package. See below
> for suggested return values in various scenarios.

[0 on success, 1 if no output was returned and 2 on error]

This isn't quite as trivial as it initially sounds, as rmadison simply
shells to curl or wget, configured to dump the script's output to
stdout.

Thinking the change through a little also raises the question of what
should happen when multiple packages and/or URLs are specified. My
inclination is that each of the following should return 0, indicating
that at least one package returned data.

$ rmadison foo bar
(where foo exists but bar does not)

$ rmadison -ufoo,bar baz
(where contacting foo returns an error but contacting bar is successful
and returns results)

Making the first case return 1 would require parsing of the output in
order to determine whether data was returned for each of the packages in
turn which, whilst doable, hard-codes knowledge of that format in to the
script, which has thus far been avoided.

That's my current thinking on this request; it's entirely possible I've
missed something.

Regards,

Adam



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to