[Yum-devel] [PATCH] Return an error code if yum can't install any of the specified packages
James Antill
james at fedoraproject.org
Thu Mar 11 21:03:45 UTC 2010
On Thu, 2010-03-11 at 15:31 -0500, Mike Bonnet wrote:
> On 03/11/2010 02:54 PM, James Antill wrote:
> > People want a bash scriptable way to say "X should be installed". So
> > with this patch:
> >
> > . If _any_ package specified: is installed already; or is found and will
> > be installed == yum returns 0 (or at least goes into depchecking etc.)
> >
> > . If _all_ package(s) are "not found", yum turns the message "Nothing to do"
> > into an error (returns 1, atm).
> >
> > ...thus:
> >
> > 1. yum install -y a b && echo worked
> >
> > This will echo "worked" if _either_ a or b is installed after yum
> > finishes, but tries to install both.
>
> I would argue that if I run "yum install -y a b" and either a or b is
> not found or not installable for any reason, then nothing should happen
> and yum should print an error and return a non-zero exitcode. Ignoring
> missing packages that are explicitly listed on the command-line has
> always seemed wrong.
So I _personally_ agree, however I'm trying to change it as little as
possible so as not to break anybody's scripts in weird ways. People can
still do the "all must be installed" by writing it out in separate
commands, and the only RFEs I've seen want to use it for a single
install like:
if yum install -y mypkg; then
# We know mypkg is installed now, do stuff with it
fi
...changing it to brea^W error out in more cases is trivial though.
More information about the Yum-devel
mailing list