[Yum-devel] [PATCH 1/2] Allow changing the exit code on non-fatal errors.

James Antill james at fedoraproject.org
Tue Mar 6 14:41:40 UTC 2012


On Tue, 2012-03-06 at 13:06 +0100, Zdeněk Pavlas wrote:
> Currently, doCommand() may return result=1 to indicate a fatal error,
> or result=0/2 to signal success.  Minor errors are usually handled just
> by printing an error message, but they can't change the exit code.
> 
> Use a read-write attribute instead of 0 as the exit code, so that minor
> errors can change it without disturbing the control flow.

 ACK. This should also solve the problem of plugins wishing to set the
exit code.
 However I'm not 100% sure we want it in YumBase(), as that isn't really
guaranteed to be used where it can exit. But then putting it in
YumBaseCli means we'll need to test for it a lot, or not use it.

 We also have the problem we've always had that we've only really
standardized 0 and 1 ... but, meh.



More information about the Yum-devel mailing list