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

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