[Yum-devel] [PATCH] Allow addons marked with 'default=true' to be selected by default.
Bill Nottingham
notting at redhat.com
Tue Apr 30 19:42:27 UTC 2013
(This depends on a yum.comps change to parse and store this attribute.)
---
pyanaconda/packaging/yumpayload.py | 14 ++++++++++++++
pyanaconda/ui/gui/spokes/software.py | 9 ++++++++-
2 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index de2c348..01bc80c 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -1023,6 +1023,20 @@ reposdir=%s
return True
return False
+ def environmentOptionIsDefault(self, environmentid, grpid):
+ groups = self._yumGroups
+ if not groups:
+ return False
+
+ with _yum_lock:
+ if not groups.has_environment(environmentid):
+ raise NoSuchGroup(environmentid)
+
+ environment = groups.return_environment(environmentid)
+ if grpid in environment.defaultoptions:
+ return True
+ return False
+
def environmentDescription(self, environmentid):
""" Return name/description tuple for the environment specified by id. """
groups = self._yumGroups
diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py
index b409aea..8b7837b 100644
--- a/pyanaconda/ui/gui/spokes/software.py
+++ b/pyanaconda/ui/gui/spokes/software.py
@@ -76,6 +76,9 @@ class SoftwareSelectionSpoke(NormalSpoke):
return
addons = self._get_selected_addons()
+ for group in addons:
+ if group not in self.selectedGroups:
+ self.selectedGroups.append(group)
self._selectFlag = False
self.payload.data.packages.groupList = []
@@ -270,7 +273,11 @@ class SoftwareSelectionSpoke(NormalSpoke):
def _addAddon(self, grp):
(name, desc) = self.payload.groupDescription(grp)
- selected = grp in self.selectedGroups
+ # If no groups are selected, select the default groups
+ if not self._origEnvironment:
+ selected = self.payload.environmentOptionIsDefault(self.environment, grp)
+ else:
+ selected = grp in self.selectedGroups
self._addonStore.append([selected, "<b>%s</b>\n%s" % (name, desc), grp, False])
--
1.8.2.1
More information about the Yum-devel
mailing list