[PATCH] Make 'yum install @group' give an error when trying to install a non-existent group

Zdenek Pavlas zpavlas at redhat.com
Fri Jan 24 16:34:14 UTC 2014

>  This isn't quite true, although maybe you know that. The rule is
> everything has to fail, so this "always" works:
>      yum install yum aksjflkajflajlaj

The exception is only propagated to the "for arg in userlist" loop, to skip
the "done=True" assignment. If any other arg was ok, the patched code still
tries to run the transaction.

> 1. base.install() can now throw GroupsError in code paths it couldn't
> before, specifically if pattern is bad in some way.
>  Probably need to create a GroupInstallError which inherits form
> InstallError

I'd say GroupsError is more appropriate, but maybe users
handle InstallError and don't handle GroupsError.. ok.

> 2. The raised exception doesn't contain any information about the string
> being used/etc. ... should at least give a message like InstallError
> does, more would be better.

Definitely, just in case it's not catched internally.

> 3. "yum upgrade alkfjalkjdflj" intentionally doesn't throw errors, it
> now does for the @grp case.

Yes, updatePkgs() should catch this exception instead of failing, too..
Dtto for reinstalls.

> 4. "yum group install foo" should probably act the same as
> "yum install @foo".

That's because "yum group install" code path does not use _at_group{install,..},
but almost identical copy of the code..  This should be either merged
or updated, too.

More information about the Yum-devel mailing list