[Yum-devel] Changed behavior of 'yum list available'

David Lutterkort dlutter at redhat.com
Wed Sep 26 18:14:28 UTC 2007


On Tue, 2007-09-25 at 22:11 -0400, James Antill wrote:
> On Tue, 2007-09-25 at 17:27 -0700, David Lutterkort wrote:
> > With commit 809c2bb1b5708d7529544c837adaa3a6949e8119, 'yum list
> > available foo' makes yum exit with an error when there are no pending
> > updates for foo, even if it is a legitimate package.
> 
>  By "legitimate" you mean, is installed ... no? The change was done due
> to a customer request, but personally I feel that if you do list "foo",
> and "foo" doesn't exist, yum shouldn't just pretend everything is fine.
> Much like ls foo, does.

I think you need to differentiate by the list subcommand; in particular,
when I run 'yum list available foo' there's two separate cases: (1)
there's no package foo in any of the configured repositories or
installed - that seems like an error in my mind (2) there is a package
foo installed or in the configured repositories, but you already have
the latest available installed - that doesn't sound like an error to me.

> > I don't understand why yum would exit with an error in that situation -
> > could that change be rolled back and an update pushed to FC7?
> 
>  Why do you think it shouldn't do anything? Ie. what's the rationale,
> apart from that's what it used to do?
>  Do you think it should exit 0 if you do "yum list available foo*" and
> there is nothing starting with foo?

Right now, it gives you an error even if there are packages with foo*,
solely because none of them need updating.

>  I assume the customer wanted to use yum from a script, like:
> 
>  if yum list blah; then
> 
> ...can you think of another way to solve that problem?

So they essentially want to use yum to find out if a certain package is
installed or in configured repositories ?

>  So saying all that, I guess I assumed that some of the other commands
> were covered but a quick test now shows that:
> 
>  yum install foo
>  yum whatprovides foo
>  yum list-security foo
>  yum seach foo
>  yum grouplist foo
>  [... probably etc. ... ]
> 
> ...all exit 0, if foo doesn't exist. So we need to change something to.

If you do, it would warrant prominent notice in release notes etc.

> >  Needless
> > to say, it breaks puppet's yum-based package updates, and the workaround
> > on the puppet end would require completely ignoring any exit code from
> > yum.
> 
>  Well I think it'd be a good idea to have a specific exit code for "no
> match for input", which would solve that problem ... no?

Yes, that would help address this, too.

David





More information about the Yum-devel mailing list