[PATCH 10/10] Add "groups mark blacklist" command to get out of the upgrade problem.

James Antill james at and.org
Tue Dec 17 22:57:03 UTC 2013


---
 docs/yum.8     |    4 ++++
 yumcommands.py |   20 ++++++++++++++++++++
 2 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/docs/yum.8 b/docs/yum.8
index e0bd5da..0e211eb 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -320,6 +320,10 @@ the packages as a member of the group.
 "\fBgroup mark packages-force\fP" works like mark packages, but doesn't care if
 the packages are already members of another group.
 
+"\fBgroup mark blacklist\fP" will blacklist all packages marked to be installed
+for a group. After this command a "yum group upgrade" will not install any new
+packages as part of the group.
+
 "\fBgroup mark convert-blacklist\fP"
 
 "\fBgroup mark convert-whitelist\fP"
diff --git a/yumcommands.py b/yumcommands.py
index f07d270..291eae5 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -965,6 +965,7 @@ class GroupsCommand(YumCommand):
         ocmds_arg = []
         if base.conf.group_command == 'objects':
             ocmds_arg = ('mark-install', 'mark-remove',
+                         'mark-blacklist',
                          'mark-packages', 'mark-packages-force',
                          'unmark-packages',
                          'mark-packages-sync', 'mark-packages-sync-force',
@@ -974,6 +975,7 @@ class GroupsCommand(YumCommand):
 
             ocmds_all = ('mark-install', 'mark-remove', 'mark-convert',
                          'mark-convert-whitelist', 'mark-convert-blacklist',
+                         'mark-blacklist',
                          'mark-packages', 'mark-packages-force',
                          'unmark-packages',
                          'mark-packages-sync', 'mark-packages-sync-force',
@@ -1063,6 +1065,24 @@ class GroupsCommand(YumCommand):
                 base.igroups.save()
                 return 0, ['Marked install: ' + ','.join(extcmds)]
 
+            if cmd == 'mark-blacklist':
+                gRG = base._groupReturnGroups(extcmds,ignore_case=False)
+                igrps, grps, ievgrps, evgrps = gRG
+                for ievgrp in ievgrps:
+                    evgrp = base.comps.return_environment(igrp.evgid)
+                    if not evgrp:
+                        continue
+                    base.igroups.changed = True
+                    ievgrp.grp_names.update(grp.groups)
+                for igrp in igrps:
+                    grp = base.comps.return_group(igrp.gid)
+                    if not grp:
+                        continue
+                    base.igroups.changed = True
+                    igrp.pkg_names.update(grp.packages)
+                base.igroups.save()
+                return 0, ['Marked upgrade blacklist: ' + ','.join(extcmds)]
+
             if cmd in ('mark-packages', 'mark-packages-force'):
                 if len(extcmds) < 2:
                     return 1, ['No group or package given']
-- 
1.7.7.6



More information about the Yum-devel mailing list