[Yum] yum exit codes

seth vidal skvidal at linux.duke.edu
Sun Mar 5 01:21:57 UTC 2006


On Fri, 2006-03-03 at 13:06 -0800, David Lutterkort wrote:
> On Fri, 2006-03-03 at 14:37 -0500, seth vidal wrote:
> > define a failure for me:
> > - if you ask to install 5 packages and 2 of them are not available in a
> > repo and 1 of them is already installed but 2 of them can be installed -
> > is that a failure or a success?
> > 
> > - if you ask to remove 2 packages and 1 is not installed and 1 is
> > installed. Is that a failure or a success.
> 
> Good questions. I would base the definition of failure on a reasonable
> definition of what the state of a system should be after running the
> corresponding yum command (and I am sure others will disagree ;) If the
> system is in any other state after the yum run, be that because a
> dependency doesn't exist in a repo, the network is down, ... that should
> be flagged as a failure witha non-zero exit code.
> 
> If I run 'yum install p1 p2 ...' I would define success as all the
> packages being installed on the system after yum finishes.
> 
> If I run 'yum remove p1 p2 ...' success should be that none of p1,
> p2, ... are installed on the system after yum finishes.

but it's not just discrete package names, either:
yum install p1* p2*

for a long while we questioned whether or not:

yum install p1 p2 

when p2 is already installed shouldn't be an error, if only b/c it is
useful to know that for dealing with that from a shell script.

and trivial operations like:

yum list foo

if foo didn't exist some folks wanted it to error out (I'm not joking)

Finally we are already using non bitmask result codes with yum
check-update and a locking failure.


We can definitely implement some sort of error code but we need to be
fairly strict about it lest we waltz into something horrible to figure
out.

-sv





More information about the Yum mailing list