[Yum-devel] [PATCH] Tweak "group X has no pkgs." warning, try to deal with cond. pkgs. BZ 655281

seth vidal skvidal at fedoraproject.org
Tue Mar 29 14:48:33 UTC 2011


On Tue, 2011-03-29 at 10:29 -0400, James Antill wrote:
> ---
>  yum/__init__.py |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/yum/__init__.py b/yum/__init__.py
> index 36fc203..d1f07d0 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -2830,9 +2830,7 @@ class YumBase(depsolve.Depsolve):
>              if 'optional' in package_types:
>                  pkgs.extend(thisgroup.optional_packages)
>  
> -            if not pkgs:
> -                self.logger.critical(_('Warning: Group %s does not have any packages.'), thisgroup.groupid)
> -
> +            old_txmbrs = len(txmbrs_used)
>              for pkg in pkgs:
>                  self.verbose_logger.log(logginglevels.DEBUG_2,
>                      _('Adding package %s from group %s'), pkg, thisgroup.groupid)
> @@ -2850,6 +2848,7 @@ class YumBase(depsolve.Depsolve):
>              if enable_group_conditionals is not None: # has to be this way so we can set it to False
>                  group_conditionals = enable_group_conditionals
>  
> +            count_cond_test = 0
>              if group_conditionals:
>                  for condreq, cond in thisgroup.conditional_packages.iteritems():
>                      if self.isPackageInstalled(cond):
> @@ -2882,10 +2881,15 @@ class YumBase(depsolve.Depsolve):
>                                  pkgs = use
>                                 
>                          pkgs = packagesNewestByName(pkgs)
> +                        count_cond_test += len(pkgs)
>  
>                          if cond not in self.tsInfo.conditionals:
>                              self.tsInfo.conditionals[cond] = []
>                          self.tsInfo.conditionals[cond].extend(pkgs)
> +            if len(txmbrs_used) == old_txmbrs:
> +                self.logger.critical(_('Warning: Group %s does not have any packages.'), thisgroup.groupid)
> +                if count_cond_test:
> +                    self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'), count_cond_test)
>          return txmbrs_used
>  
>      def deselectGroup(self, grpid, force=False):


ACK - not sure how much better this makes it, though.

-sv




More information about the Yum-devel mailing list