[Yum] Re: yum exit codes
skvidal at linux.duke.edu
Sun Mar 5 01:22:58 UTC 2006
On Fri, 2006-03-03 at 13:31 -0700, Michael Stenner wrote:
> On Fri, Mar 03, 2006 at 02:54:50PM -0500, Ryan Frantz wrote:
> > Perhaps exit codes should be more defined. For example, '0' would
> > always be absolute success (all packages installed successfully).
> > 1 = One or more packages failed to install dependencies
> > 2 = One or more packages are already installed
> > 4 = All selected packages failed
> > ...
> I think this is indeed the way to go. Several notes:
> 1) it doesn't need to be perfect. The idea is to provide something
> useful to people that need a quick-and-dirty. We have a full
> python interface if folks need more.
> 2) there's not a lot of room for feedback. If you go the bitmask
> route, there are 16 bits? I suggest leaving a few for "general"
> feedback and the rest for specific feedback. For example:
> 1 - warnings, but not necessarily error (this to be determined
> by seth unilaterally or after some discussion)
> 2 - some sort of error (same)
> 4 - package(s) already installed (also 1)
> 8 - requested package could not be installed (also 2)
> 3) another approach would be to not use bitmasks but specific codes
> 1 - unspecified error
> 2 - unspecified warning
> 3 - packages already installed
> 4 - package could not be installed
> You get more room with this approach, but you can't combine.
> Anyway, my main point is that 0 should mean nothing wacky happened
> (again, just make the call to serve as many people as possible... the
> rest will just have to cope), provide specific feedback for a few
> common cases and provide general feedback for the rest. That'll meet
> the needs of 95% of the people who want this. The rest will have to
> suck it up. That's what they have to do now.
One thing I don't like about bitmasks is that they're frequently
misunderstood by people seeing them for the first time and they're
extremely limiting in terms of what states something can be in.
Finally, we're already using non-bitmasked error codes so we're kinda
More information about the Yum