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

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