[PATCH master and f18-beta-branch (take 2)] Make language groups work again (#873865)

Jesse Keating jkeating at redhat.com
Tue Nov 6 22:04:11 UTC 2012


We have to potentially unmangle a lang value from say es_ES.UTF-8 down
to just "es" in order to find the group within comps.
---
 pyanaconda/packaging/yumpayload.py | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 97f0c8e..0c53dde0 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -80,6 +80,9 @@ from pyanaconda.errors import *
 from pyanaconda.packaging import NoSuchGroup, NoSuchPackage
 import pyanaconda.progress as progress
 
+from pyanaconda.localization import expand_langs
+import itertools
+
 from pykickstart.constants import KS_MISSING_IGNORE
 
 default_repos = [productName.lower(), "rawhide"]
@@ -918,9 +921,15 @@ reposdir=%s
 
         if yum_groups:
             with _yum_lock:
-                groups = [g.groupid for g in yum_groups.get_groups() if g.langonly == lang]
-
-        return groups
+                langs = expand_langs(lang)
+                groups = map(lambda x: [g.groupid for g in
+                             yum_groups.get_groups() if g.langonly == x],
+                             langs)
+
+        # the map gives us a list of results, this  set call reduces
+        # it down to a unique set, then list() makes it back into a list.
+        # what the * does is a mystery!
+        return list(set(itertools.chain(*groups)))
 
     def groupDescription(self, groupid):
         """ Return name/description tuple for the group specified by id. """
-- 
1.7.11.4



More information about the anaconda-patches mailing list