---
 cli.py          |    4 ++--
 docs/yum.8      |    8 ++++----
 yum/__init__.py |   21 ++++++++++++++-------
 3 files changed, 20 insertions(+), 13 deletions(-)

diff --git a/cli.py b/cli.py
index 5c3b9c3..8d782c8 100644
--- a/cli.py
+++ b/cli.py
@@ -1337,7 +1337,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
         
         return 0, []
         
-    def installGroups(self, grouplist):
+    def installGroups(self, grouplist, upgrade=False):
         """for each group requested do 'selectGroup' on them."""
         
         pkgs_used = []
@@ -1349,7 +1349,7 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
 
             
                 try:
-                    txmbrs = self.selectGroup(group.groupid)
+                    txmbrs = self.selectGroup(group.groupid, upgrade=upgrade)
                 except yum.Errors.GroupsError:
                     self.logger.critical(_('Warning: Group %s does not 
exist.'), group_string)
                     continue
diff --git a/docs/yum.8 b/docs/yum.8
index 1a8202a..37aa004 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -202,9 +202,9 @@ the command line for a "yum install" command).
  The group_package_types configuration option specifies which types will
 be installed.
 
-"\fBgroup update\fP" is just an alias for groupinstall, which will do the 
right thing because
-"yum install X" and "yum update X" do the same thing, when X is already
-installed.
+"\fBgroup update\fP" works similarly to group install, except performs an 
update rather than an install.
+ The group_package_types configuration option specifies which types will
+be installed.
 
 "\fBgroup list\fP" is used to list the available groups from all \fByum\fP 
repos. Groups are marked
 as "installed" if all mandatory packages are installed, or if a group doesn't
@@ -214,7 +214,7 @@ The optional "hidden" argument will also list groups marked 
as not being
 "user visible". If you pass the \-v option, to enable verbose mode, then the
 groupids are displayed.
 
-"\fBgroup remove\fP" is used to remove all of the packages in a group, unlike 
"groupinstall" this
+"\fBgroup remove\fP" is used to remove all of the packages in a group, unlike 
"group install" this
 will remove everything regardless of group_package_types. It is worth pointing
 out that packages can be in more than one group, so "group install X Y" 
followed
 by "group remove Y" does not do give you the same result as "group install X".
diff --git a/yum/__init__.py b/yum/__init__.py
index ab2bb9d..68211b7 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2845,7 +2845,7 @@ class YumBase(depsolve.Depsolve):
                             self.tsInfo.remove(txmbr.po.pkgtup)
         
         
-    def selectGroup(self, grpid, group_package_types=[], 
enable_group_conditionals=None):
+    def selectGroup(self, grpid, group_package_types=[], 
enable_group_conditionals=None, upgrade=False):
         """mark all the packages in the group to be installed
            returns a list of transaction members it added to the transaction 
            set
@@ -2861,7 +2861,7 @@ class YumBase(depsolve.Depsolve):
         thesegroups = self.comps.return_groups(grpid)
      
         if not thesegroups:
-            raise Errors.GroupsError, _("No Group named %s exists") % 
to_unicode(grpid)
+            raise Errors.GroupsError, _("No Group named %s exists in the 
repos.") % to_unicode(grpid)
 
         package_types = self.conf.group_package_types
         if group_package_types:
@@ -2886,7 +2886,10 @@ class YumBase(depsolve.Depsolve):
                 self.verbose_logger.log(logginglevels.DEBUG_2,
                     _('Adding package %s from group %s'), pkg, 
thisgroup.groupid)
                 try:
-                    txmbrs = self.install(name = pkg)
+                    if upgrade:
+                        txmbrs = self.update(name = pkg)
+                    else:
+                        txmbrs = self.install(name = pkg)
                 except Errors.InstallError, e:
                     self.verbose_logger.debug(_('No package named %s available 
to be installed'),
                         pkg)
@@ -3300,19 +3303,23 @@ class YumBase(depsolve.Depsolve):
             if next == slow:
                 return None
 
-    def _at_groupinstall(self, pattern):
-        " Do groupinstall via. leading @ on the cmd line, for install/update."
+    def _at_groupinstall(self, pattern, upgrade=False):
+        " Do groupinstall via. leading @ on the cmd line, for install."
         assert pattern[0] == '@'
         group_string = pattern[1:]
         tx_return = []
         for group in self.comps.return_groups(group_string):
             try:
-                txmbrs = self.selectGroup(group.groupid)
+                txmbrs = self.selectGroup(group.groupid, upgrade=upgrade)
                 tx_return.extend(txmbrs)
             except yum.Errors.GroupsError:
                 self.logger.critical(_('Warning: Group %s does not exist.'), 
group_string)
                 continue
         return tx_return
+
+    def _at_groupupgrade(self, pattern):
+        " Do group upgrade via. leading @ on the cmd line, for update."
+        return self._at_groupinstall(pattern, upgrade=True)
         
     def _at_groupremove(self, pattern):
         " Do groupremove via. leading @ on the cmd line, for remove."
@@ -3734,7 +3741,7 @@ class YumBase(depsolve.Depsolve):
                 return self._minus_deselect(kwargs['pattern'])
 
             if kwargs['pattern'] and kwargs['pattern'][0] == '@':
-                return self._at_groupinstall(kwargs['pattern'])
+                return self._at_groupupgrade(kwargs['pattern'])
 
             arg = kwargs['pattern']
             if not update_to:
-- 
1.7.5.2

_______________________________________________
Yum-devel mailing list
[email protected]
http://lists.baseurl.org/mailman/listinfo/yum-devel

Reply via email to