From 8c896377da4a5f30f7a90721bd3e129fbf47d86d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 13 Apr 2021 10:48:05 +0200 Subject: [PATCH] Filter out empty specfile-errors, they are duplicates Before: $ rpmlint python-setuptools.spec python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 58: %endif # with tests python-setuptools.spec: E: specfile-error python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 67: %endif # without bootstrap python-setuptools.spec: E: specfile-error python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 181: %endif # with tests 0 packages and 1 specfiles checked; 5 errors, 0 warnings. After: $ rpmlint python-setuptools.spec python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 58: %endif # with tests python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 67: %endif # without bootstrap python-setuptools.spec: E: specfile-error warning: extra tokens at the end of %endif directive in line 181: %endif # with tests 0 packages and 1 specfiles checked; 3 errors, 0 warnings. --- rpmlint.config | 3 +++ rpmlint.spec | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/rpmlint.config b/rpmlint.config index 1223091..8ee93fd 100644 --- a/rpmlint.config +++ b/rpmlint.config @@ -463,6 +463,9 @@ addFilter("postin-without-install-info") addFilter(r"zero-length .+/site-packages/.+\.dist-info/REQUESTED\b") # py.typed files are empty addFilter(r"zero-length .+/site-packages/.+/py\.typed\b") +# specfile-errors are listed twice, once with reason and once without +# we filter out the empty ones +addFilter(r"\.(src|spec): (E|W): specfile-error\s+$") bad_crypto_warning = \ '''This application package calls a function to explicitly set crypto ciphers diff --git a/rpmlint.spec b/rpmlint.spec index e7b8bf1..f1ca390 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -20,7 +20,7 @@ Name: rpmlint Version: 1.11 -Release: 15%{?dist} +Release: 16%{?dist} Summary: Tool for checking common errors in RPM packages License: GPLv2 URL: https://github.com/rpm-software-management/rpmlint @@ -165,6 +165,9 @@ make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8} %{_mandir}/man1/rpmlint.1* %changelog +* Tue Apr 13 2021 Miro HronĨok - 1.11-16 +- Filter out empty specfile-errors, they are duplicates + * Fri Feb 5 2021 Tom Callaway - 1.11-15 - correct hard-coded version in Makefile