From 9264b997312250ba6c306e63e3c7c06c35564bc5 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 05:44:38 +0000 Subject: import yum-langpacks-0.4.2-7.el7 --- diff --git a/SOURCES/yum-langpacks-0.4.2-Add-parser-for-Release_Notes-packages.patch b/SOURCES/yum-langpacks-0.4.2-Add-parser-for-Release_Notes-packages.patch new file mode 100644 index 0000000..3770b32 --- /dev/null +++ b/SOURCES/yum-langpacks-0.4.2-Add-parser-for-Release_Notes-packages.patch @@ -0,0 +1,82 @@ +From f86e94c305e2a82fc66eab0bdae18ae8e063304d Mon Sep 17 00:00:00 2001 +From: Parag Nemade +Date: Fri, 22 Apr 2016 19:42:39 +0530 +Subject: [PATCH] Resolves:rh#1263241 - Add parser for Release_Notes packages + +--- + langpacks.py | 38 ++++++++++++++++++++++++++++++++++++-- + 1 file changed, 36 insertions(+), 2 deletions(-) + +diff --git a/langpacks.py b/langpacks.py +index 2e162a0..9b235b7 100644 +--- a/langpacks.py ++++ b/langpacks.py +@@ -94,7 +94,10 @@ def read_available_langpacks (base = None): + yb = base + + srchpkglist = [] +- skip_pkg_list = ['devel', 'browser', 'debuginfo', 'music', 'overrides', 'Brazil', 'British', 'Farsi', 'LowSaxon', 'cs_CZ'] ++ skip_pkg_list = ['devel', 'browser', 'debuginfo', 'music', 'overrides', ++ 'Brazil', 'British', 'Farsi', 'LowSaxon', 'cs_CZ', ++ 'mysql', 'common', 'examples', 'ibase', 'odbc', ++ 'postgresql', 'static'] + langlist = [] + seen = set() + +@@ -316,7 +319,11 @@ def get_matches_from_repo(langpack_pkgs, lang): + if lang.find("_") != -1: + mainlang = lang[0:lang.find("_")] + if lang.find("_CN") != -1 and pkgs.find("-CN") != -1: +- avl_langpack_pkgs.append(pkgs) ++ # this check to ensure Release_notes package ++ # not listed twice for langinfo of zh_CN ++ # only show man-pages-zh-CN ++ if pkgs.find("man-pages") != -1: ++ avl_langpack_pkgs.append(pkgs) + if pkgs.find(lang, len(pkgs)-len(lang), len(pkgs)) > 0: + avl_langpack_pkgs.append(pkgs) + # if input pt_BR then show for pt and pt_BR +@@ -627,13 +634,40 @@ class LanginfoCommand: + # Case to handle input like zh_CN, pt_BR + elif lang in whitelisted_locales and len(lang) > 3 and lang.find("_") != -1: + list_pkgs = get_matches_from_repo(langpack_pkgs, lang) ++ # check RHEL7 release notes package ++ if lang.find("pt_BR") != -1: ++ relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + "pt-BR" ++ if lang.find("zh_CN") != -1: ++ relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + "zh-CN" ++ if lang.find("zh_TW") != -1: ++ relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + "zh-TW" ++ for pkg in langpack_pkgs: ++ if pkg.find(relnotpkg) != -1: ++ list_pkgs.append(pkg) ++ break + # Case for full language name input like Japanese + elif len(lang) > 3 and lang.find("_") == -1: ++ if len(langname_to_lc(lang)) == 0: ++ print "Not a valid language name" ++ return 0, [""] ++ + list_pkgs = get_matches_from_repo(langpack_pkgs, langname_to_lc(lang)) ++ # check RHEL7 release notes package ++ relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + langname_to_lc(lang) ++ for pkg in langpack_pkgs: ++ if pkg.find(relnotpkg) != -1: ++ list_pkgs.append(pkg) ++ break + # General case to handle input like ja, ru, fr, it + else: + if lang.find("_") == -1: + list_pkgs = get_matches_from_repo(langpack_pkgs, lang) ++ # check RHEL7 release notes package ++ relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + lang ++ for pkg in langpack_pkgs: ++ if pkg.find(relnotpkg) != -1: ++ list_pkgs.append(pkg) ++ break + # Case to not process mr_IN or mai_IN locales + else: + list_pkgs = [] +-- +1.8.3.1 + diff --git a/SOURCES/yum-langpacks-0.4.2-Add-parser-for-libreoffice-langpacks.patch b/SOURCES/yum-langpacks-0.4.2-Add-parser-for-libreoffice-langpacks.patch new file mode 100644 index 0000000..e0823b3 --- /dev/null +++ b/SOURCES/yum-langpacks-0.4.2-Add-parser-for-libreoffice-langpacks.patch @@ -0,0 +1,30 @@ +From 1a9dbf3127391086dad5e05d016e8dcdc0a55999 Mon Sep 17 00:00:00 2001 +From: Parag Nemade +Date: Fri, 22 Apr 2016 19:44:03 +0530 +Subject: [PATCH] Resolves:rh#1251388 - Add parser for libreoffice langpacks + +--- + langpacks.py | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/langpacks.py b/langpacks.py +index 9b235b7..9680953 100644 +--- a/langpacks.py ++++ b/langpacks.py +@@ -637,10 +637,13 @@ class LanginfoCommand: + # check RHEL7 release notes package + if lang.find("pt_BR") != -1: + relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + "pt-BR" ++ list_pkgs.append("libreoffice-langpack-pt-BR") + if lang.find("zh_CN") != -1: + relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + "zh-CN" ++ list_pkgs.append("libreoffice-langpack-zh-Hans") + if lang.find("zh_TW") != -1: + relnotpkg = "Red_Hat_Enterprise_Linux-Release_Notes-7-" + "zh-TW" ++ list_pkgs.append("libreoffice-langpack-zh-Hant") + for pkg in langpack_pkgs: + if pkg.find(relnotpkg) != -1: + list_pkgs.append(pkg) +-- +1.8.3.1 + diff --git a/SOURCES/yum-langpacks-0.4.2-fix-anaconda-installation-packages.patch b/SOURCES/yum-langpacks-0.4.2-fix-anaconda-installation-packages.patch new file mode 100644 index 0000000..b0e4b04 --- /dev/null +++ b/SOURCES/yum-langpacks-0.4.2-fix-anaconda-installation-packages.patch @@ -0,0 +1,90 @@ +diff --git a/langpacks.py b/langpacks.py +index e1225c6..b6578cd 100644 +--- a/langpacks.py ++++ b/langpacks.py +@@ -364,24 +364,67 @@ def add_deps_to_ts(conduit, po): + sack = conduit.getRepos().getPackageSack() + yb = conduit._base + for lang in langs: +- pkgs = get_matches(sack, list = map(lambda x: x % (lang,), conds)) +- if not pkgs and lang != '*': +- shortlang = lang.split('_')[0] +- pkgs = get_matches(sack, list = map(lambda x: x % (shortlang,), conds)) +- for pkg in pkgs: +- if yb.rpmdb.searchNevra(name=pkg.name): +- continue +- if yb.tsInfo.matchNaevr(name=pkg.name): +- continue +- if hasattr(conduit, 'registerPackageName'): +- conduit.registerPackageName("yum-langpacks") +- try: +- yb.install(pattern=pkg.name) +- if lang not in langinstalled: +- langinstalled.append(lang) +- except yum.Errors.YumBaseError: +- conduit.info(5,"Failed to install package %s" % (pkg.name,)) +- continue ++ lang = lang[:-6] ++ if lang.find("zh_CN") != -1 and po.name.find("man-pages") != -1: ++ try: ++ yb.install(pattern="man-pages-zh-CN") ++ if lang not in langinstalled: ++ langinstalled.append(lang) ++ except yum.Errors.YumBaseError: ++ conduit.info(5,"Failed to install package man-pages-zh-CN") ++ continue ++ if lang.find("zh_CN") != -1 and po.name.find("libreoffice-core") != -1: ++ try: ++ yb.install(pattern="libreoffice-langpack-zh-Hans") ++ if lang not in langinstalled: ++ langinstalled.append(lang) ++ except yum.Errors.YumBaseError: ++ conduit.info(5,"Failed to install package libreoffice-langpack-zh-Hans") ++ continue ++ # This is strange case where pt_BR works but not zh_CN, hardcode this ++ if lang.find("zh_CN") != -1 and po.name.find("gimp-help") != -1: ++ try: ++ yb.install(pattern="gimp-help-zh_CN") ++ if lang not in langinstalled: ++ langinstalled.append(lang) ++ except yum.Errors.YumBaseError: ++ conduit.info(5,"Failed to install package gimp-help-zh_CN") ++ continue ++ if lang.find("zh_TW") != -1 and po.name.find("libreoffice-core") != -1: ++ try: ++ yb.install(pattern="libreoffice-langpack-zh-Hant") ++ if lang not in langinstalled: ++ langinstalled.append(lang) ++ except yum.Errors.YumBaseError: ++ conduit.info(5,"Failed to install package libreoffice-langpack-zh-Hant") ++ continue ++ if lang.find("pt_BR") != -1 and po.name.find("libreoffice-core") != -1: ++ try: ++ yb.install(pattern="libreoffice-langpack-pt-BR") ++ if lang not in langinstalled: ++ langinstalled.append(lang) ++ except yum.Errors.YumBaseError: ++ conduit.info(5,"Failed to install package libreoffice-langpack-zh-Hant") ++ continue ++ else: ++ pkgs = get_matches(sack, list = map(lambda x: x % (lang,), conds)) ++ if not pkgs and lang != '*': ++ shortlang = lang.split('_')[0] ++ pkgs = get_matches(sack, list = map(lambda x: x % (shortlang,), conds)) ++ for pkg in pkgs: ++ if yb.rpmdb.searchNevra(name=pkg.name): ++ continue ++ if yb.tsInfo.matchNaevr(name=pkg.name): ++ continue ++ if hasattr(conduit, 'registerPackageName'): ++ conduit.registerPackageName("yum-langpacks") ++ try: ++ yb.install(pattern=pkg.name) ++ if lang not in langinstalled: ++ langinstalled.append(lang) ++ except yum.Errors.YumBaseError: ++ conduit.info(5,"Failed to install package %s" % (pkg.name,)) ++ continue + + def remove_deps_from_ts(conduit, po): + conds = conditional_pkgs[po.name] diff --git a/SOURCES/yum-langpacks-0.4.2-fix-langlist-command.patch b/SOURCES/yum-langpacks-0.4.2-fix-langlist-command.patch new file mode 100644 index 0000000..d44a87b --- /dev/null +++ b/SOURCES/yum-langpacks-0.4.2-fix-langlist-command.patch @@ -0,0 +1,22 @@ +diff -urN yum-langpacks-0.4.2/langpacks.py yum-langpacks-0.4.2.new/langpacks.py +--- yum-langpacks-0.4.2/langpacks.py 2015-02-24 14:15:49.684389233 +0530 ++++ yum-langpacks-0.4.2.new/langpacks.py 2015-02-24 14:17:09.517381490 +0530 +@@ -595,10 +595,14 @@ + + def doCommand(self, base, basecmd, extcmds): + list = read_installed_langpacks() +- print "Installed languages:" +- for item in list: +- if not item.startswith("#"): +- print "\t" + lc_to_langname(item) ++ if list: ++ print "Installed languages:" ++ for item in list: ++ if not item.startswith("#"): ++ print "\t" + lc_to_langname(item) ++ else: ++ print("No langpacks installed") ++ + return 0, [""] + + class LanginfoCommand: diff --git a/SPECS/yum-langpacks.spec b/SPECS/yum-langpacks.spec index efcf3b2..231b9b0 100644 --- a/SPECS/yum-langpacks.spec +++ b/SPECS/yum-langpacks.spec @@ -1,13 +1,17 @@ Summary: Langpacks plugin for yum Name: yum-langpacks Version: 0.4.2 -Release: 4%{?dist} +Release: 7%{?dist} License: GPLv2+ Group: Development/Tools Source0: https://fedorahosted.org/releases/y/u/%{name}/%{name}-%{version}.tar.gz # upstream commited patches Patch0: yum-langpacks-0.4.2-fix-langinfo-command.patch Patch1: yum-langpacks-0.4.2-fix-zh_CN-locale-packages.patch +Patch2: yum-langpacks-0.4.2-fix-langlist-command.patch +Patch3: yum-langpacks-0.4.2-Add-parser-for-Release_Notes-packages.patch +Patch4: yum-langpacks-0.4.2-Add-parser-for-libreoffice-langpacks.patch +Patch5: yum-langpacks-0.4.2-fix-anaconda-installation-packages.patch URL: https://fedorahosted.org/yum-langpacks/ BuildArch: noarch @@ -24,6 +28,10 @@ language for packages you install. %setup -q %patch0 -p1 %patch1 -p1 +%patch2 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 %build @@ -41,6 +49,17 @@ install -p -m 644 yum-langpacks.8.gz %{buildroot}%{_mandir}/man8/yum-langpacks.8 %{_mandir}/man8/yum-langpacks.8.gz %changelog +* Tue May 10 2016 Parag Nemade - 0.4.2-7 +- Resolves:rh#1251388 - Add parser for anaconda package installation + +* Wed May 04 2016 Parag Nemade - 0.4.2-6 +- Resolves:rh#1251388 - Add parser for anaconda package installation + +* Fri Apr 22 2016 Parag Nemade - 0.4.2-5 +- Resolves:rh#1192870 - Fix langlist when installed_langpacks not available +- Resolves:rh#1263241 - Add parser for Release_Notes packages +- Resolves:rh#1251388 - Add parser for libreoffice langpacks + * Wed Jun 03 2015 Parag Nemade - 0.4.2-4 - Resolves:rh#1165731: man-pages-zh-CN is not installed for zh_CN