[Yum] yum exit codes

David Lutterkort dlutter at redhat.com
Mon Mar 6 20:54:36 UTC 2006

On Sat, 2006-03-04 at 20:21 -0500, seth vidal wrote:
> On Fri, 2006-03-03 at 13:06 -0800, David Lutterkort wrote:
> > 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*

Do you mean with that: what if there are no packages matching 'p1*' -
should that be a failure or not ? I could go either way with that.

> 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.

Good point. I think the basic question is: what is the user saying when
they execute a yum command ? Are they specifying the actions yum should
execute (in which case I would flag the above as an error) or are they
specifying what they want their system to look like after yum is done
(in which case the above shouldn't be an error)

I can't really say which of those two views I would prefer. Does anybody
see any clear downsides to either of them ? For the purposes of exit
codes, we should stick with one or the other, so that people that rely
on them have a clear understanding what yum will and won't signal them
through exit codes.

> 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.

Agreed. What kind of horrors do you have in mind there ? Is it making it
clear to users what the exit codes mean in a comprehensible way or is it
more than that ?


More information about the Yum mailing list