From 226fb2015635cc9f4b12aac8ecdc9ffbb4febdbdce311fee4ae88671dd1483af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Li=C5=A1ka?= Date: Tue, 12 Jul 2022 20:38:35 +0000 Subject: [PATCH] - Add skip-rpmlint-for-rpmlint.patch patch that skip linter this package. OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=931 --- rpmlint.changes | 6 ++++++ rpmlint.spec | 1 + skip-rpmlint-for-rpmlint.patch | 37 ++++++++++++++++++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 skip-rpmlint-for-rpmlint.patch diff --git a/rpmlint.changes b/rpmlint.changes index ebbe67f..6eb2a61 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Jul 12 20:38:18 UTC 2022 - Martin Liška + +- Add skip-rpmlint-for-rpmlint.patch patch that skip linter + this package. + ------------------------------------------------------------------- Tue Jul 12 20:15:59 UTC 2022 - mliska@suse.cz diff --git a/rpmlint.spec b/rpmlint.spec index 19c2761..c0668a0 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -30,6 +30,7 @@ License: GPL-2.0-or-later URL: https://github.com/rpm-software-management/rpmlint Source0: rpmlint-%{version}.tar.xz Patch0: disable-flake.patch +Patch1: skip-rpmlint-for-rpmlint.patch BuildRequires: fdupes BuildRequires: python3-setuptools BuildArch: noarch diff --git a/skip-rpmlint-for-rpmlint.patch b/skip-rpmlint-for-rpmlint.patch new file mode 100644 index 0000000..737cb53 --- /dev/null +++ b/skip-rpmlint-for-rpmlint.patch @@ -0,0 +1,37 @@ +diff --git a/rpmlint/lint.py b/rpmlint/lint.py +index 7afadbc3..df5437e4 100644 +--- a/rpmlint/lint.py ++++ b/rpmlint/lint.py +@@ -5,6 +5,7 @@ import operator + import os + from pathlib import Path + from pstats import Stats ++import re + import sys + from tempfile import gettempdir + import time +@@ -22,6 +23,8 @@ class Lint(object): + Generic object handling the basic rpmlint operations + """ + ++ rpmlint_package = re.compile(r'/home/abuild/rpmbuild/RPMS/noarch/rpmlint-\d') ++ + def __init__(self, options): + # initialize configuration + self.checks = {} +@@ -53,6 +56,15 @@ class Lint(object): + self.config.configuration['ExtractDir'] = gettempdir() + # initialize output buffer + self.output = Filter(self.config) ++ ++ # Do not run rpmlint on rpmlint package that easily leads ++ # to run-time error as old rpmlint (taken from rpmlint-mini) ++ # uses a modified configuration. ++ for file in self.options['rpmfile']: ++ if self.rpmlint_package.search(str(file)): ++ print('Skipping rpmlint for rpmlint package!') ++ sys.exit(3) ++ + # preload the check list if we not print config + # some of the config values are transformed e.g. to regular + # expressions