[PATCH] yum-cron: Fix formatting of group upgrades
James Antill
james at fedoraproject.org
Tue Dec 10 16:01:49 UTC 2013
On Tue, 2013-12-10 at 11:46 +0100, Zdenek Pavlas wrote:
> ---
> yum-cron/yum-cron.py | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
What is the change here? Also how come you changed just yum-cron and
not yum too?
> diff --git a/yum-cron/yum-cron.py b/yum-cron/yum-cron.py
> index f53fbfb..096a994 100755
> --- a/yum-cron/yum-cron.py
> +++ b/yum-cron/yum-cron.py
> @@ -426,19 +426,12 @@ class UpdateEmitter(object):
>
> return a_wid
>
> - ninstalled = self.tsInfo.installed
> ginstalled = {}
> - if self.conf.group_command == 'objects' and ninstalled:
> - # Show new pkgs. that are installed via. a group.
Did you mean to remove this check?
I purposely did that as without object groups it seemed a bit weird to
say that the packages were installed because of X but then we'd forget
about it later. I guess people might still find it useful though.
> - ninstalled = []
> - for txmbr in self.tsInfo.installed:
> - if not hasattr(txmbr, '_ugroup_member'):
> - ninstalled.append(txmbr)
> - continue
> - if txmbr._ugroup_member not in ginstalled:
> - ginstalled[txmbr._ugroup_member] = []
> - ginstalled[txmbr._ugroup_member].append(txmbr)
> + for txmbr in tsInfo.installed:
> + grp = getattr(txmbr, '_ugroup_member', None)
> + ginstalled.setdefault(grp, []).append(txmbr)
> + ninstalled = ginstalled.pop(None, [])
Maybe I just need a lot more tea, but I think the '-' part and the '+'
parts do the same thing, just in different ways. There is a change from
self.tsInfo to just tsInfo, which is correct ... but AFAICS doesn't
change anything (tsInfo always == self.tsInfo) and it was nice to have
exactly the same code as output.py.
More information about the Yum-devel
mailing list