From 39f2f25c6abd7074535c33630e4c61f7c99f9bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Sun, 10 Mar 2019 12:19:03 +0100 Subject: [PATCH] Suppress locale error in order to work in default mock (#1668400) --- rpmlint-1.10-suppress-locale-error.patch | 38 ++++++++++++++++++++++++ rpmlint.spec | 7 ++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 rpmlint-1.10-suppress-locale-error.patch diff --git a/rpmlint-1.10-suppress-locale-error.patch b/rpmlint-1.10-suppress-locale-error.patch new file mode 100644 index 0000000..319d204 --- /dev/null +++ b/rpmlint-1.10-suppress-locale-error.patch @@ -0,0 +1,38 @@ +From 30290f021b58d381ce2baaa393a4902fb69e624a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Sun, 10 Mar 2019 11:54:59 +0100 +Subject: [PATCH] Suppress errors when setting LC_COLLATE, the problem is not + fatal + +Fixes https://github.com/rpm-software-management/rpmlint/issues/198 +Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1668400 +--- + rpmlint | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/rpmlint b/rpmlint +index dd835ba..cc8f327 100755 +--- a/rpmlint ++++ b/rpmlint +@@ -9,6 +9,7 @@ + # the checks. + ############################################################################# + ++import contextlib + import getopt + import glob + import locale +@@ -89,7 +90,9 @@ def loadCheck(name): + ############################################################################# + def main(): + +- locale.setlocale(locale.LC_COLLATE, '') ++ # we'll try to sort with locale settings, but we don't fail if not possible ++ with contextlib.suppress(locale.Error): ++ locale.setlocale(locale.LC_COLLATE, '') + + # Add check dirs to the front of load path + sys.path[0:0] = Config.checkDirs() +-- +2.20.1 + diff --git a/rpmlint.spec b/rpmlint.spec index 308fe5c..5bea9a7 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -23,7 +23,7 @@ Name: rpmlint Version: 1.10 -Release: 21%{?dist} +Release: 22%{?dist} Summary: Tool for checking common errors in RPM packages License: GPLv2 URL: https://github.com/rpm-software-management/rpmlint @@ -52,6 +52,7 @@ BuildRequires: python3-pytest Requires: python3 Requires: rpm-python3 >= 4.4.2.2 Patch5: rpmlint-1.10-force-python3.patch +Patch6: rpmlint-1.10-suppress-locale-error.patch %else BuildRequires: python >= 2.6 BuildRequires: rpm-python >= 4.4.2.2 @@ -101,6 +102,7 @@ and source packages as well as spec files can be checked. %patch4 -p1 -b .py37magic %if %{with python3} %patch5 -p1 +%patch6 -p1 %endif sed -i -e /MenuCheck/d Config.py cp -p config config.example @@ -144,6 +146,9 @@ make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8} %{_mandir}/man1/rpmlint.1* %changelog +* Sun Mar 10 2019 Miro HronĨok - 1.10-22 +- Suppress locale error in order to work in default mock (#1668400) + * Sat Feb 02 2019 Fedora Release Engineering - 1.10-21 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild