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

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