[Yum-devel] [PATCH] cleanups for Groups_Info._installedgroups

Sean Dilda agrajag at dragaera.net
Tue Jan 25 19:03:02 UTC 2005


I was looking over the _installedgroups function in the Groups_Info 
class and noticed a few things that looked like they'd be useful.

First off, I added some break statements.  Once you find a single 
mandatory package for a group that isn't installed, there's no need to 
look through the rest of the mandatory packages as you already know the 
group isn't installed.  This same logic with a little twist is the 
reason behind the other two break statements.

And although mandatory metapkgs don't really exist, there were also a 
few issues in the code for handling them.  First I removed a redundant 
if statement.  Also, the inside of the loop for mandatory metapkgs did 
nothing but set a local variable that'd never be looked at.  So, I fixed 
it to actually modify the setting that would be kept around.

And now that I'm writing this, it strikes me that this code (with or 
without my patch) won't properly handle groups without any mandatory 
packages that have metapkgs.  Or is this case taken care of elsewhere?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: yum-installedgroups.patch
Type: text/x-patch
Size: 1650 bytes
Desc: not available
Url : http://lists.baseurl.org/pipermail/yum-devel/attachments/20050125/99f51260/attachment.bin 


More information about the Yum-devel mailing list