SHA256
1
0
forked from pool/rpmlint

- 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
This commit is contained in:
Martin Liška
2022-07-12 20:38:35 +00:00
committed by Git OBS Bridge
parent 48ecd051b2
commit 226fb20156
3 changed files with 44 additions and 0 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Jul 12 20:38:18 UTC 2022 - Martin Liška <mliska@suse.cz>
- Add skip-rpmlint-for-rpmlint.patch patch that skip linter
this package.
-------------------------------------------------------------------
Tue Jul 12 20:15:59 UTC 2022 - mliska@suse.cz

View File

@@ -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

View File

@@ -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