Blame SOURCES/yum-langpacks-0.4.2-fix-anaconda-installation-packages.patch

9264b9
diff --git a/langpacks.py b/langpacks.py
9264b9
index e1225c6..b6578cd 100644
9264b9
--- a/langpacks.py
9264b9
+++ b/langpacks.py
9264b9
@@ -364,24 +364,67 @@ def add_deps_to_ts(conduit, po):
9264b9
     sack = conduit.getRepos().getPackageSack()
9264b9
     yb = conduit._base
9264b9
     for lang in langs:
9264b9
-        pkgs = get_matches(sack, list = map(lambda x: x % (lang,), conds))
9264b9
-        if not pkgs and lang != '*':
9264b9
-            shortlang = lang.split('_')[0]
9264b9
-            pkgs = get_matches(sack, list = map(lambda x: x % (shortlang,), conds))
9264b9
-        for pkg in pkgs:
9264b9
-            if yb.rpmdb.searchNevra(name=pkg.name):
9264b9
-                continue
9264b9
-            if yb.tsInfo.matchNaevr(name=pkg.name):
9264b9
-                continue
9264b9
-            if hasattr(conduit, 'registerPackageName'):
9264b9
-                conduit.registerPackageName("yum-langpacks")
9264b9
-            try:
9264b9
-                yb.install(pattern=pkg.name)
9264b9
-                if lang not in langinstalled:
9264b9
-                    langinstalled.append(lang)
9264b9
-            except yum.Errors.YumBaseError:
9264b9
-                conduit.info(5,"Failed to install package %s" % (pkg.name,))
9264b9
-                continue
9264b9
+        lang = lang[:-6]
9264b9
+        if lang.find("zh_CN") != -1 and po.name.find("man-pages") != -1:
9264b9
+           try:
9264b9
+              yb.install(pattern="man-pages-zh-CN")
9264b9
+              if lang not in langinstalled:
9264b9
+                  langinstalled.append(lang)
9264b9
+           except yum.Errors.YumBaseError:
9264b9
+              conduit.info(5,"Failed to install package man-pages-zh-CN")
9264b9
+              continue
9264b9
+        if lang.find("zh_CN") != -1 and po.name.find("libreoffice-core") != -1:
9264b9
+           try:
9264b9
+              yb.install(pattern="libreoffice-langpack-zh-Hans")
9264b9
+              if lang not in langinstalled:
9264b9
+                  langinstalled.append(lang)
9264b9
+           except yum.Errors.YumBaseError:
9264b9
+              conduit.info(5,"Failed to install package libreoffice-langpack-zh-Hans")
9264b9
+              continue
9264b9
+        # This is strange case where pt_BR works but not zh_CN, hardcode this
9264b9
+        if lang.find("zh_CN") != -1 and po.name.find("gimp-help") != -1:
9264b9
+           try:
9264b9
+              yb.install(pattern="gimp-help-zh_CN")
9264b9
+              if lang not in langinstalled:
9264b9
+                  langinstalled.append(lang)
9264b9
+           except yum.Errors.YumBaseError:
9264b9
+              conduit.info(5,"Failed to install package gimp-help-zh_CN")
9264b9
+              continue
9264b9
+        if lang.find("zh_TW") != -1 and po.name.find("libreoffice-core") != -1:
9264b9
+           try:
9264b9
+              yb.install(pattern="libreoffice-langpack-zh-Hant")
9264b9
+              if lang not in langinstalled:
9264b9
+                  langinstalled.append(lang)
9264b9
+           except yum.Errors.YumBaseError:
9264b9
+              conduit.info(5,"Failed to install package libreoffice-langpack-zh-Hant")
9264b9
+              continue
9264b9
+        if lang.find("pt_BR") != -1 and po.name.find("libreoffice-core") != -1:
9264b9
+           try:
9264b9
+              yb.install(pattern="libreoffice-langpack-pt-BR")
9264b9
+              if lang not in langinstalled:
9264b9
+                  langinstalled.append(lang)
9264b9
+           except yum.Errors.YumBaseError:
9264b9
+              conduit.info(5,"Failed to install package libreoffice-langpack-zh-Hant")
9264b9
+              continue
9264b9
+        else: 
9264b9
+            pkgs = get_matches(sack, list = map(lambda x: x % (lang,), conds))
9264b9
+            if not pkgs and lang != '*':
9264b9
+                shortlang = lang.split('_')[0]
9264b9
+                pkgs = get_matches(sack, list = map(lambda x: x % (shortlang,), conds))
9264b9
+            for pkg in pkgs:
9264b9
+                if yb.rpmdb.searchNevra(name=pkg.name):
9264b9
+                    continue
9264b9
+                if yb.tsInfo.matchNaevr(name=pkg.name):
9264b9
+                    continue
9264b9
+                if hasattr(conduit, 'registerPackageName'):
9264b9
+                    conduit.registerPackageName("yum-langpacks")
9264b9
+                try:
9264b9
+                   yb.install(pattern=pkg.name)
9264b9
+                   if lang not in langinstalled:
9264b9
+                      langinstalled.append(lang)
9264b9
+                except yum.Errors.YumBaseError:
9264b9
+                    conduit.info(5,"Failed to install package %s" % (pkg.name,))
9264b9
+                    continue
9264b9
 
9264b9
 def remove_deps_from_ts(conduit, po):
9264b9
     conds = conditional_pkgs[po.name]