Blame SOURCES/BZ-1052436-group-bundle-pre-f20-fixes.patch

d2a170
commit 8b977a860595a02dc13b5eefd5f8783ba23e4acf
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Nov 18 17:14:48 2013 -0500
d2a170
d2a170
    Add _ugroup_member to txmbr, list installed for groups pkgs. BZ 1031374.
d2a170
d2a170
diff --git a/output.py b/output.py
d2a170
index cf9e985..e42702e 100755
d2a170
--- a/output.py
d2a170
+++ b/output.py
d2a170
@@ -1506,7 +1506,30 @@ class YumOutput:
d2a170
             a_wid = max(a_wid, len(a))
d2a170
             return a_wid
d2a170
 
d2a170
-        for (action, pkglist) in [(_('Installing'), self.tsInfo.installed),
d2a170
+        ninstalled = self.tsInfo.installed
d2a170
+        ginstalled = {}
d2a170
+        if self.conf.group_command == 'objects' and ninstalled:
d2a170
+            # Show new pkgs. that are installed via. a group.
d2a170
+            ninstalled = []
d2a170
+            for txmbr in self.tsInfo.installed:
d2a170
+                if not hasattr(txmbr, '_ugroup_member'):
d2a170
+                    ninstalled.append(txmbr)
d2a170
+                    continue
d2a170
+                if txmbr._ugroup_member not in ginstalled:
d2a170
+                    ginstalled[txmbr._ugroup_member] = []
d2a170
+                ginstalled[txmbr._ugroup_member].append(txmbr)
d2a170
+
d2a170
+        for grp in sorted(ginstalled, key=lambda x: x.ui_name):
d2a170
+            action = _('Installing for group upgrade "%s"') % grp.ui_name
d2a170
+            pkglist = ginstalled[grp]
d2a170
+
d2a170
+            lines = []
d2a170
+            for txmbr in pkglist:
d2a170
+                a_wid = _add_line(lines, data, a_wid, txmbr.po, txmbr.obsoletes)
d2a170
+
d2a170
+            pkglist_lines.append((action, lines))
d2a170
+
d2a170
+        for (action, pkglist) in [(_('Installing'), ninstalled),
d2a170
                             (_('Updating'), self.tsInfo.updated),
d2a170
                             (_('Removing'), self.tsInfo.removed),
d2a170
                             (_('Reinstalling'), self.tsInfo.reinstalled),
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 6bd5962..f212884 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3845,6 +3845,8 @@ much more problems).
d2a170
                                               pkg_warning_level='debug2')
d2a170
                         for txmbr in txmbrs:
d2a170
                             txmbr.group_member = thisgroup.groupid
d2a170
+                            if lupgrade: # For list transaction.
d2a170
+                                txmbr._ugroup_member = thisgroup
d2a170
                 except Errors.InstallError, e:
d2a170
                     self.verbose_logger.debug(_('No package named %s available to be installed'),
d2a170
                         pkg)
d2a170
commit 4a84e0f3d3954fdf0a94ecf61775ae9af43f2a4d
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 16:03:57 2013 -0500
d2a170
d2a170
    Remove old FIXME for env. groups, fixes "group lists" without patterns.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index caafae4..69e8043 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3520,8 +3520,7 @@ much more problems).
d2a170
             if self.conf.group_command == 'objects':
d2a170
                 igrps = self.igroups.groups.values()
d2a170
             evgrps = self.comps.environments
d2a170
-            if False and self.conf.group_command == 'objects':
d2a170
-                # FIXME: Environment groups.
d2a170
+            if self.conf.group_command == 'objects':
d2a170
                 ievgrps = self.igroups.environments.values()
d2a170
             return igrps, grps, ievgrps, evgrps
d2a170
 
d2a170
commit 42c82dd60dc498e7a2419b291a2392e77ffa5ded
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 16:31:33 2013 -0500
d2a170
d2a170
    Confirm/assert new mocked igrps/ievgrps behaviour.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 69e8043..230a2e3 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3629,6 +3629,12 @@ much more problems).
d2a170
         if ievgrps is None:
d2a170
             ievgrps = {}
d2a170
 
d2a170
+        #  Note that we used to get here with igrps/ievgrps that didn't exist
d2a170
+        # in comps. but we mock them in comps now because it was hard to deal
d2a170
+        # with that everywhere ... so just to confirm.
d2a170
+        assert not igrps
d2a170
+        assert not ievgrps
d2a170
+
d2a170
         for igrp in igrps.values():
d2a170
             #  These are installed groups that aren't in comps anymore. so we
d2a170
             # create fake comps groups for them.
d2a170
commit e2c3d3f909088ba5e1cc237d2b57eab669e7befd
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 15:29:06 2013 -0500
d2a170
d2a170
    Warn iff return_{groups, environments} returned an empty list. BZ 1043207.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 230a2e3..d051a1c 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -4458,24 +4458,31 @@ much more problems).
d2a170
         if group_string and group_string[0] == '^':
d2a170
             group_string = group_string[1:]
d2a170
             # Actually dealing with "environment groups".
d2a170
+            found = False
d2a170
             for env_grp in comps.return_environments(group_string):
d2a170
+                found = True
d2a170
                 try:
d2a170
                     txmbrs = self.selectEnvironment(env_grp.environmentid,
d2a170
                                                     upgrade=upgrade)
d2a170
                     tx_return.extend(txmbrs)
d2a170
                 except yum.Errors.GroupsError:
d2a170
-                    self.logger.critical(_('Warning: Environment Group %s does not exist.'), group_string)
d2a170
+                    assert False, "Checked in for loop."
d2a170
                     continue
d2a170
+            if not found:
d2a170
+                self.logger.error(_('Warning: Environment group %s does not exist.'),
d2a170
+                                  group_string)
d2a170
             return tx_return
d2a170
 
d2a170
+        found = False
d2a170
         for group in comps.return_groups(group_string):
d2a170
+            found = True
d2a170
             try:
d2a170
                 txmbrs = self.selectGroup(group.groupid, upgrade=upgrade)
d2a170
                 tx_return.extend(txmbrs)
d2a170
             except yum.Errors.GroupsError:
d2a170
-                self.logger.critical(_('Warning: Group %s does not exist.'), group_string)
d2a170
+                assert False, "Checked in for loop."
d2a170
                 continue
d2a170
-        else:
d2a170
+        if not found:
d2a170
             self.logger.error(_('Warning: group %s does not exist.'),
d2a170
                               group_string)
d2a170
 
d2a170
commit 406dae058a021cf1171666c4e779721ef7ac680e
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 17:34:40 2013 -0500
d2a170
d2a170
    Remove old test to allow comma separated grpid for selectGroup().
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index d051a1c..2709225 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3771,9 +3771,6 @@ much more problems).
d2a170
            transaction set by this function
d2a170
         """
d2a170
 
d2a170
-        if not self.comps.has_group(grpid):
d2a170
-            raise Errors.GroupsError, _("No Group named %s exists") % to_unicode(grpid)
d2a170
-        
d2a170
         txmbrs_used = []
d2a170
         thesegroups = self.comps.return_groups(grpid)
d2a170
      
d2a170
commit 1cedb184fe356252b0f22988ef8cd88d2de365ce
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 17:37:16 2013 -0500
d2a170
d2a170
    Contain selectGroup() exceptions when selecting environments. BZ 1014202.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 2709225..72052ab 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -4007,10 +4007,13 @@ much more problems).
d2a170
                                                  evgrp.allgroups)
d2a170
                 grps = ",".join(sorted(grps))
d2a170
 
d2a170
-            txs = self.selectGroup(grps,
d2a170
-                                   group_package_types,
d2a170
-                                   enable_group_conditionals, upgrade,
d2a170
-                                   ievgrp=ievgrp)
d2a170
+            try:
d2a170
+                txs = self.selectGroup(grps,
d2a170
+                                       group_package_types,
d2a170
+                                       enable_group_conditionals, upgrade,
d2a170
+                                       ievgrp=ievgrp)
d2a170
+            except Errors.GroupsError:
d2a170
+                continue
d2a170
             ret.extend(txs)
d2a170
         return ret
d2a170
 
d2a170
commit 23b51f3242f066ebfa3d79df1a1122293f8ab432
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 17:38:22 2013 -0500
d2a170
d2a170
    Add groups from installed environments, and unique, so we don't miss any.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 72052ab..633bd76 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3991,7 +3991,7 @@ much more problems).
d2a170
             elif self.conf.group_command == 'objects':
d2a170
                 igroup_data = self._groupInstalledEnvData(evgrp)
d2a170
  
d2a170
-                grps = []
d2a170
+                grps = set()
d2a170
                 for grpid in evgrp.groups:
d2a170
                     if (grpid not in igroup_data or
d2a170
                         igroup_data[grpid].startswith('blacklisted')):
d2a170
@@ -3999,9 +3999,10 @@ much more problems).
d2a170
                         self.verbose_logger.log(logginglevels.DEBUG_2,
d2a170
                                                 msg, grpid, evgrp.environmentid)
d2a170
                         continue
d2a170
-                    grps.append(grpid)
d2a170
+                    grps.add(grpid)
d2a170
                 if evgrp.environmentid in self.igroups.environments:
d2a170
                     ievgrp = self.igroups.environments[evgrp.environmentid]
d2a170
+                    grps.update(ievgrp.grp_names)
d2a170
                 else:
d2a170
                     self.igroups.add_environment(evgrp.environmentid,
d2a170
                                                  evgrp.allgroups)
d2a170
commit 4926655b7acd588de34322b07a5cf54de24f33dc
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 17:48:16 2013 -0500
d2a170
d2a170
    Change groupupdate command to call "group update" back compat. too confusing.
d2a170
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index b346128..e01c96d 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -890,7 +890,7 @@ class GroupsCommand(YumCommand):
d2a170
 
d2a170
     direct_commands = {'grouplist'    : 'list',
d2a170
                        'groupinstall' : 'install',
d2a170
-                       'groupupdate'  : 'install',
d2a170
+                       'groupupdate'  : 'update',
d2a170
                        'groupremove'  : 'remove',
d2a170
                        'grouperase'   : 'remove',
d2a170
                        'groupinfo'    : 'info'}
d2a170
commit 0a07500f2c4c76a1cb1ef428a7585238802e0a86
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Mon Dec 16 17:49:15 2013 -0500
d2a170
d2a170
    Have "yum group upgrade" do all, as "yum upgrade" does in objs. mode.
d2a170
d2a170
diff --git a/cli.py b/cli.py
d2a170
index 180ba99..be8c46f 100755
d2a170
--- a/cli.py
d2a170
+++ b/cli.py
d2a170
@@ -1913,6 +1913,14 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
             2 = we've got work yet to do, onto the next stage
d2a170
         """
d2a170
         pkgs_used = []
d2a170
+
d2a170
+        if not grouplist and self.conf.group_command == 'objects':
d2a170
+            #  Do what "yum upgrade" does when upgrade_group_objects_upgrade is
d2a170
+            # set.
d2a170
+            for ievgrp in self.igroups.environments:
d2a170
+                pkgs_used.extend(self._at_groupupgrade('@^' + ievgrp))
d2a170
+            for igrp in self.igroups.groups:
d2a170
+                pkgs_used.extend(self._at_groupupgrade('@'  + igrp))
d2a170
         
d2a170
         for group_string in grouplist:
d2a170
 
d2a170
commit c8f16477b2deaeaf78ba88b9ea38b565061412a9
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 10:48:44 2013 -0500
d2a170
d2a170
    Don't add all grps in the installed evgrp, just those that belong.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 633bd76..b7eedf4 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -4002,7 +4002,15 @@ much more problems).
d2a170
                     grps.add(grpid)
d2a170
                 if evgrp.environmentid in self.igroups.environments:
d2a170
                     ievgrp = self.igroups.environments[evgrp.environmentid]
d2a170
-                    grps.update(ievgrp.grp_names)
d2a170
+                    #  Add groups from the installed evgrp, for Eg. installed
d2a170
+                    # only evgrps.
d2a170
+                    for grp_name in ievgrp.grp_names:
d2a170
+                        if grp_name not in self.igroups.groups:
d2a170
+                            continue
d2a170
+                        grp_evgrpid = self.igroups.groups[grp_name].environment
d2a170
+                        if grp_evgrpid != evgrp.environmentid:
d2a170
+                            continue
d2a170
+                        grps.add(grp_name)
d2a170
                 else:
d2a170
                     self.igroups.add_environment(evgrp.environmentid,
d2a170
                                                  evgrp.allgroups)
d2a170
commit a6f1124787cff91c435f9c8da2d658fe241ad026
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 16:36:31 2013 -0500
d2a170
d2a170
    Don't confuse <group info> output by giving data for optional when it's off.
d2a170
d2a170
diff --git a/output.py b/output.py
d2a170
index 041910c..eb38d7d 100755
d2a170
--- a/output.py
d2a170
+++ b/output.py
d2a170
@@ -1131,10 +1131,14 @@ class YumOutput:
d2a170
         if group.langonly:
d2a170
             print _(' Language: %s') % group.langonly
d2a170
 
d2a170
-        sections = ((_(' Mandatory Packages:'),   group.mandatory_packages),
d2a170
-                    (_(' Default Packages:'),     group.default_packages),
d2a170
-                    (_(' Optional Packages:'),    group.optional_packages),
d2a170
-                    (_(' Conditional Packages:'), group.conditional_packages))
d2a170
+        sections = (('mandatory', _(' Mandatory Packages:'),
d2a170
+                     group.mandatory_packages),
d2a170
+                    ('default',  _(' Default Packages:'),
d2a170
+                     group.default_packages),
d2a170
+                    ('optional', _(' Optional Packages:'),
d2a170
+                     group.optional_packages),
d2a170
+                    (None, _(' Conditional Packages:'),
d2a170
+                     group.conditional_packages))
d2a170
         columns = None
d2a170
         if verb:
d2a170
             data = {'envra' : {}, 'rid' : {}}
d2a170
@@ -1145,12 +1149,21 @@ class YumOutput:
d2a170
             columns = self.calcColumns(data)
d2a170
             columns = (-columns[0], -columns[1])
d2a170
 
d2a170
-        for (section_name, pkg_names) in sections:
d2a170
+        for (section_type, section_name, pkg_names) in sections:
d2a170
+            #  Only display igroup data for things that we'll actually try to
d2a170
+            # install.
d2a170
+            if section_type is None:
d2a170
+                tigroup_data = igroup_data
d2a170
+            elif section_type in self.conf.group_package_types:
d2a170
+                tigroup_data = igroup_data
d2a170
+            else:
d2a170
+                tigroup_data = None
d2a170
+
d2a170
             if len(pkg_names) > 0:
d2a170
                 print section_name
d2a170
                 self._displayPkgsFromNames(pkg_names, verb, pkg_names2pkgs,
d2a170
                                            columns=columns,
d2a170
-                                           igroup_data=igroup_data)
d2a170
+                                           igroup_data=tigroup_data)
d2a170
         if igrp_only:
d2a170
             print _(' Installed Packages:')
d2a170
             self._displayPkgsFromNames(igrp_only, verb, pkg_names2pkgs,
d2a170
commit 14bf13706a708764065e729998a30a991541906e
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 16:40:00 2013 -0500
d2a170
d2a170
    Pass the ievgrp to groups for new installed envs., so they belong. BZ 1043231
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index b7eedf4..1c17768 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -4012,8 +4012,8 @@ much more problems).
d2a170
                             continue
d2a170
                         grps.add(grp_name)
d2a170
                 else:
d2a170
-                    self.igroups.add_environment(evgrp.environmentid,
d2a170
-                                                 evgrp.allgroups)
d2a170
+                    ievgrp = self.igroups.add_environment(evgrp.environmentid,
d2a170
+                                                          evgrp.allgroups)
d2a170
                 grps = ",".join(sorted(grps))
d2a170
 
d2a170
             try:
d2a170
commit d6ddfc90cda8c4e735a55628960ff623f40b27f6
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 17:01:13 2013 -0500
d2a170
d2a170
    Fix typo with simple groups compile of environment with only options.
d2a170
d2a170
diff --git a/yum/comps.py b/yum/comps.py
d2a170
index 706e2a4..92e87ba 100755
d2a170
--- a/yum/comps.py
d2a170
+++ b/yum/comps.py
d2a170
@@ -879,7 +879,7 @@ class Comps(object):
d2a170
                         break
d2a170
             else:
d2a170
                 evgroup.installed = False
d2a170
-                for grpname in evgroup.optional:
d2a170
+                for grpname in evgroup.options:
d2a170
                     if grpname in inst_grp_names:
d2a170
                         evgroup.installed = True
d2a170
                         break
d2a170
commit 926f893eaa933b086d442957ee271348bfb1d2a3
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 16:56:19 2013 -0500
d2a170
d2a170
    Fix mark-convert-whitelist, and add mark-convert-blacklist (default).
d2a170
d2a170
diff --git a/docs/yum.8 b/docs/yum.8
d2a170
index dff88af..e0bd5da 100644
d2a170
--- a/docs/yum.8
d2a170
+++ b/docs/yum.8
d2a170
@@ -320,9 +320,19 @@ the packages as a member of the group.
d2a170
 "\fBgroup mark packages-force\fP" works like mark packages, but doesn't care if
d2a170
 the packages are already members of another group.
d2a170
 
d2a170
-"\fBgroup mark convert\fP" converts the automatic data you get without using
d2a170
-groups as objects into groups as objects data. This makes it much easier to
d2a170
-convert to groups as objects without having to reinstall.
d2a170
+"\fBgroup mark convert-blacklist\fP"
d2a170
+
d2a170
+"\fBgroup mark convert-whitelist\fP"
d2a170
+
d2a170
+"\fBgroup mark convert\fP" converts the automatic data you get
d2a170
+without using groups as objects into groups as objects data, in other words
d2a170
+this will make "yum --setopt=group_command=objects groups list" look as similar
d2a170
+as possible to the current output of
d2a170
+"yum --setopt=group_command=simple groups list". This makes it much
d2a170
+easier to convert to groups as objects without having to reinstall. For groups
d2a170
+that are installed the whitelist variant will mark all uninstalled packages for
d2a170
+the group as to be installed on the next "yum group upgrade", the blacklist
d2a170
+variant (current default) will mark them all as blacklisted.
d2a170
 
d2a170
 "\fBgroup unmark packages\fP" remove a package as a member from any groups.
d2a170
 .IP
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index e01c96d..f07d270 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -973,6 +973,7 @@ class GroupsCommand(YumCommand):
d2a170
                          'mark-groups-sync', 'mark-groups-sync-force')
d2a170
 
d2a170
             ocmds_all = ('mark-install', 'mark-remove', 'mark-convert',
d2a170
+                         'mark-convert-whitelist', 'mark-convert-blacklist',
d2a170
                          'mark-packages', 'mark-packages-force',
d2a170
                          'unmark-packages',
d2a170
                          'mark-packages-sync', 'mark-packages-sync-force',
d2a170
@@ -1002,13 +1003,13 @@ class GroupsCommand(YumCommand):
d2a170
             pass
d2a170
         elif not os.path.exists(os.path.dirname(base.igroups.filename)):
d2a170
             base.logger.critical(_("There is no installed groups file."))
d2a170
-            base.logger.critical(_("Maybe run: yum groups mark convert"))
d2a170
+            base.logger.critical(_("Maybe run: yum groups mark convert (see man yum)"))
d2a170
         elif not os.access(os.path.dirname(base.igroups.filename), os.R_OK):
d2a170
             base.logger.critical(_("You don't have access to the groups DBs."))
d2a170
             raise cli.CliError
d2a170
         elif not os.path.exists(base.igroups.filename):
d2a170
             base.logger.critical(_("There is no installed groups file."))
d2a170
-            base.logger.critical(_("Maybe run: yum groups mark convert"))
d2a170
+            base.logger.critical(_("Maybe run: yum groups mark convert (see man yum)"))
d2a170
         elif not os.access(base.igroups.filename, os.R_OK):
d2a170
             base.logger.critical(_("You don't have access to the groups DB."))
d2a170
             raise cli.CliError
d2a170
@@ -1157,14 +1158,15 @@ class GroupsCommand(YumCommand):
d2a170
                     return 0, ['Marked groups-sync: ' + ','.join(extcmds)]
d2a170
 
d2a170
             # FIXME: This doesn't do environment groups atm.
d2a170
-            if cmd == 'mark-convert':
d2a170
+            if cmd in ('mark-convert',
d2a170
+                       'mark-convert-whitelist', 'mark-convert-blacklist'):
d2a170
                 # Convert old style info. into groups as objects.
d2a170
 
d2a170
                 def _convert_grp(grp):
d2a170
                     if not grp.installed:
d2a170
                         return
d2a170
                     pkg_names = []
d2a170
-                    for pkg in base.rpmdb.searchNames(pkg_names):
d2a170
+                    for pkg in base.rpmdb.searchNames(grp.packages):
d2a170
                         if 'group_member' in pkg.yumdb_info:
d2a170
                             continue
d2a170
                         pkg.yumdb_info.group_member = grp.groupid
d2a170
@@ -1173,7 +1175,10 @@ class GroupsCommand(YumCommand):
d2a170
                     #  We only mark the packages installed as a known part of
d2a170
                     # the group. This way "group update" will work and install
d2a170
                     # any remaining packages, as it would before the conversion.
d2a170
-                    base.igroups.add_group(grp.groupid, pkg_names)
d2a170
+                    if cmd == 'mark-convert-whitelist':
d2a170
+                        base.igroups.add_group(grp.groupid, pkg_names)
d2a170
+                    else:
d2a170
+                        base.igroups.add_group(grp.groupid, grp.packages)
d2a170
 
d2a170
                 # Blank everything.
d2a170
                 for gid in base.igroups.groups.keys():
d2a170
commit 22f07ea55219b325b17e93406ee272a1ba492378
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 17:19:12 2013 -0500
d2a170
d2a170
    Add _igroup_member, so we can find installing groups for output.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 1c17768..b86c451 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3849,6 +3849,8 @@ much more problems).
d2a170
                             txmbr.group_member = thisgroup.groupid
d2a170
                             if lupgrade: # For list transaction.
d2a170
                                 txmbr._ugroup_member = thisgroup
d2a170
+                            else:
d2a170
+                                txmbr._igroup_member = thisgroup
d2a170
                 except Errors.InstallError, e:
d2a170
                     self.verbose_logger.debug(_('No package named %s available to be installed'),
d2a170
                         pkg)
d2a170
commit d8794ef4df1704b65f2dbb97ad5a94c7c02b134e
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 17:19:28 2013 -0500
d2a170
d2a170
    Show install groups as well as upgrading groups in transaction output.
d2a170
d2a170
diff --git a/output.py b/output.py
d2a170
index eb38d7d..38045e9 100755
d2a170
--- a/output.py
d2a170
+++ b/output.py
d2a170
@@ -1525,16 +1525,26 @@ class YumOutput:
d2a170
             # Show new pkgs. that are installed via. a group.
d2a170
             ninstalled = []
d2a170
             for txmbr in self.tsInfo.installed:
d2a170
-                if not hasattr(txmbr, '_ugroup_member'):
d2a170
+                if hasattr(txmbr, '_igroup_member'):
d2a170
+                    key = ('i', txmbr._igroup_member)
d2a170
+                    if key not in ginstalled:
d2a170
+                        ginstalled[key] = []
d2a170
+                    ginstalled[key].append(txmbr)
d2a170
+                elif hasattr(txmbr, '_ugroup_member'):
d2a170
+                    key = ('u', txmbr._ugroup_member)
d2a170
+                    if key not in ginstalled:
d2a170
+                        ginstalled[key] = []
d2a170
+                    ginstalled[key].append(txmbr)
d2a170
+                else:
d2a170
                     ninstalled.append(txmbr)
d2a170
-                    continue
d2a170
-                if txmbr._ugroup_member not in ginstalled:
d2a170
-                    ginstalled[txmbr._ugroup_member] = []
d2a170
-                ginstalled[txmbr._ugroup_member].append(txmbr)
d2a170
 
d2a170
-        for grp in sorted(ginstalled, key=lambda x: x.ui_name):
d2a170
-            action = _('Installing for group upgrade "%s"') % grp.ui_name
d2a170
-            pkglist = ginstalled[grp]
d2a170
+        for (T, grp) in sorted(ginstalled, key=lambda x: x[1].ui_name):
d2a170
+            if T == 'u':
d2a170
+                msg = _('Installing for group upgrade "%s"')
d2a170
+            else:
d2a170
+                msg = _('Installing for group install "%s"')
d2a170
+            action = msg % grp.ui_name
d2a170
+            pkglist = ginstalled[(T, grp)]
d2a170
 
d2a170
             lines = []
d2a170
             for txmbr in pkglist:
d2a170
commit 5bd3c6aa6926a427a7ef660868ac7aa1adbd83f9
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 17:24:17 2013 -0500
d2a170
d2a170
    Canonicalize the "no group" warnings to env. group and pkg group.
d2a170
d2a170
diff --git a/cli.py b/cli.py
d2a170
index be8c46f..2873656 100755
d2a170
--- a/cli.py
d2a170
+++ b/cli.py
d2a170
@@ -1944,7 +1944,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                     txmbrs = self.selectEnvironment(group.environmentid,
d2a170
                                                     upgrade=upgrade)
d2a170
                 except yum.Errors.GroupsError:
d2a170
-                    self.logger.critical(_('Warning: environment %s does not exist.'), group_string)
d2a170
+                    self.logger.critical(_('Warning: Environment group %s does not exist.'), group_string)
d2a170
                     continue
d2a170
                 else:
d2a170
                     pkgs_used.extend(txmbrs)
d2a170
@@ -1958,7 +1958,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                 try:
d2a170
                     txmbrs = self.selectGroup(group.groupid, upgrade=upgrade)
d2a170
                 except yum.Errors.GroupsError:
d2a170
-                    self.logger.critical(_('Warning: group %s does not exist.'), group_string)
d2a170
+                    self.logger.critical(_('Warning: Package group %s does not exist.'), group_string)
d2a170
                     continue
d2a170
                 else:
d2a170
                     pkgs_used.extend(txmbrs)
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index b86c451..41c932c 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -4494,7 +4494,7 @@ much more problems).
d2a170
                 assert False, "Checked in for loop."
d2a170
                 continue
d2a170
         if not found:
d2a170
-            self.logger.error(_('Warning: group %s does not exist.'),
d2a170
+            self.logger.error(_('Warning: Package group %s does not exist.'),
d2a170
                               group_string)
d2a170
 
d2a170
         return tx_return
d2a170
commit 31ef7b51e3d079e0f0203af1366e38577cdc8947
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 17:38:22 2013 -0500
d2a170
d2a170
    Tell users how to mark install/remove groups without packages.
d2a170
d2a170
diff --git a/cli.py b/cli.py
d2a170
index 2873656..c05a4cf 100755
d2a170
--- a/cli.py
d2a170
+++ b/cli.py
d2a170
@@ -1968,6 +1968,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                 continue
d2a170
             
d2a170
         if not pkgs_used:
d2a170
+            if base.conf.group_command == 'objects':
d2a170
+                self.logger.critical(_("Maybe run: yum groups mark install (see man yum)"))
d2a170
             return 0, [_('No packages in any requested group available to install or update')]
d2a170
         else:
d2a170
             return 2, [P_('%d package to Install', '%d packages to Install', len(pkgs_used)) % len(pkgs_used)]
d2a170
@@ -2024,6 +2026,8 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                     pkgs_used.extend(txmbrs)
d2a170
                 
d2a170
         if not pkgs_used:
d2a170
+            if base.conf.group_command == 'objects':
d2a170
+                self.logger.critical(_("Maybe run: yum groups mark remove (see man yum)"))
d2a170
             return 0, [_('No packages to remove from groups')]
d2a170
         else:
d2a170
             return 2, [P_('%d package to remove', '%d packages to remove', len(pkgs_used)) % len(pkgs_used)]
d2a170
commit 3722c9a8f3d1435462dd1abcf62a571a1b4b4d29
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Tue Dec 17 17:38:26 2013 -0500
d2a170
d2a170
    Add "groups mark blacklist" command to get out of the upgrade problem.
d2a170
d2a170
diff --git a/docs/yum.8 b/docs/yum.8
d2a170
index e0bd5da..0e211eb 100644
d2a170
--- a/docs/yum.8
d2a170
+++ b/docs/yum.8
d2a170
@@ -320,6 +320,10 @@ the packages as a member of the group.
d2a170
 "\fBgroup mark packages-force\fP" works like mark packages, but doesn't care if
d2a170
 the packages are already members of another group.
d2a170
 
d2a170
+"\fBgroup mark blacklist\fP" will blacklist all packages marked to be installed
d2a170
+for a group. After this command a "yum group upgrade" will not install any new
d2a170
+packages as part of the group.
d2a170
+
d2a170
 "\fBgroup mark convert-blacklist\fP"
d2a170
 
d2a170
 "\fBgroup mark convert-whitelist\fP"
d2a170
diff --git a/yumcommands.py b/yumcommands.py
d2a170
index f07d270..291eae5 100644
d2a170
--- a/yumcommands.py
d2a170
+++ b/yumcommands.py
d2a170
@@ -965,6 +965,7 @@ class GroupsCommand(YumCommand):
d2a170
         ocmds_arg = []
d2a170
         if base.conf.group_command == 'objects':
d2a170
             ocmds_arg = ('mark-install', 'mark-remove',
d2a170
+                         'mark-blacklist',
d2a170
                          'mark-packages', 'mark-packages-force',
d2a170
                          'unmark-packages',
d2a170
                          'mark-packages-sync', 'mark-packages-sync-force',
d2a170
@@ -974,6 +975,7 @@ class GroupsCommand(YumCommand):
d2a170
 
d2a170
             ocmds_all = ('mark-install', 'mark-remove', 'mark-convert',
d2a170
                          'mark-convert-whitelist', 'mark-convert-blacklist',
d2a170
+                         'mark-blacklist',
d2a170
                          'mark-packages', 'mark-packages-force',
d2a170
                          'unmark-packages',
d2a170
                          'mark-packages-sync', 'mark-packages-sync-force',
d2a170
@@ -1063,6 +1065,24 @@ class GroupsCommand(YumCommand):
d2a170
                 base.igroups.save()
d2a170
                 return 0, ['Marked install: ' + ','.join(extcmds)]
d2a170
 
d2a170
+            if cmd == 'mark-blacklist':
d2a170
+                gRG = base._groupReturnGroups(extcmds,ignore_case=False)
d2a170
+                igrps, grps, ievgrps, evgrps = gRG
d2a170
+                for ievgrp in ievgrps:
d2a170
+                    evgrp = base.comps.return_environment(igrp.evgid)
d2a170
+                    if not evgrp:
d2a170
+                        continue
d2a170
+                    base.igroups.changed = True
d2a170
+                    ievgrp.grp_names.update(grp.groups)
d2a170
+                for igrp in igrps:
d2a170
+                    grp = base.comps.return_group(igrp.gid)
d2a170
+                    if not grp:
d2a170
+                        continue
d2a170
+                    base.igroups.changed = True
d2a170
+                    igrp.pkg_names.update(grp.packages)
d2a170
+                base.igroups.save()
d2a170
+                return 0, ['Marked upgrade blacklist: ' + ','.join(extcmds)]
d2a170
+
d2a170
             if cmd in ('mark-packages', 'mark-packages-force'):
d2a170
                 if len(extcmds) < 2:
d2a170
                     return 1, ['No group or package given']
d2a170
commit 1ec588666b376e5a61446c6ca1cd5ae764e0a590
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Wed Dec 18 16:19:10 2013 -0500
d2a170
d2a170
    Fix typo in new mark install/remove messages.
d2a170
d2a170
diff --git a/cli.py b/cli.py
d2a170
index c05a4cf..5b44b2c 100755
d2a170
--- a/cli.py
d2a170
+++ b/cli.py
d2a170
@@ -1968,7 +1968,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                 continue
d2a170
             
d2a170
         if not pkgs_used:
d2a170
-            if base.conf.group_command == 'objects':
d2a170
+            if self.conf.group_command == 'objects':
d2a170
                 self.logger.critical(_("Maybe run: yum groups mark install (see man yum)"))
d2a170
             return 0, [_('No packages in any requested group available to install or update')]
d2a170
         else:
d2a170
@@ -2026,7 +2026,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
d2a170
                     pkgs_used.extend(txmbrs)
d2a170
                 
d2a170
         if not pkgs_used:
d2a170
-            if base.conf.group_command == 'objects':
d2a170
+            if self.conf.group_command == 'objects':
d2a170
                 self.logger.critical(_("Maybe run: yum groups mark remove (see man yum)"))
d2a170
             return 0, [_('No packages to remove from groups')]
d2a170
         else:
d2a170
commit 48f1ff768211fc5c6b7e0254b0e655b4a4ba451e
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Thu Dec 19 00:00:26 2013 -0500
d2a170
d2a170
    Delete extra break from for to if change, which now breaks outer loop.
d2a170
d2a170
diff --git a/yum/__init__.py b/yum/__init__.py
d2a170
index 41c932c..9fb88d4 100644
d2a170
--- a/yum/__init__.py
d2a170
+++ b/yum/__init__.py
d2a170
@@ -3506,7 +3506,6 @@ much more problems).
d2a170
 
d2a170
             if igrp.environment == evgroup.environmentid:
d2a170
                 ret[grp_name] = 'installed'
d2a170
-                break
d2a170
             else:
d2a170
                 ret[grp_name] = 'blacklisted-installed'
d2a170
 
d2a170
commit 9d4dae82c83df81197502b4a4bebc73c1cb3bd3e
d2a170
Author: James Antill <james@and.org>
d2a170
Date:   Fri Dec 20 14:46:33 2013 -0500
d2a170
d2a170
    Fix traceback in group info -v.
d2a170
d2a170
diff --git a/output.py b/output.py
d2a170
index 38045e9..2787d86 100755
d2a170
--- a/output.py
d2a170
+++ b/output.py
d2a170
@@ -1142,7 +1142,7 @@ class YumOutput:
d2a170
         columns = None
d2a170
         if verb:
d2a170
             data = {'envra' : {}, 'rid' : {}}
d2a170
-            for (section_name, pkg_names) in sections:
d2a170
+            for (section_type, section_name, pkg_names) in sections:
d2a170
                 self._calcDataPkgColumns(data, pkg_names, pkg_names2pkgs,
d2a170
                                          igroup_data=igroup_data)
d2a170
             data = [data['envra'], data['rid']]