diff --git a/0001-TagsCheck-handle-license-exception-in-grouping.patch b/0001-TagsCheck-handle-license-exception-in-grouping.patch new file mode 100644 index 0000000..022c079 --- /dev/null +++ b/0001-TagsCheck-handle-license-exception-in-grouping.patch @@ -0,0 +1,101 @@ +From 7d707f7f370c31f3d9841415c1458a2d21640a15 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger +Date: Fri, 3 Mar 2023 12:56:37 -0500 +Subject: [PATCH] TagsCheck: handle license exception in grouping + +A valid license exception which is in a grouping is reported as invalid. +This is due to the trailing ')' being included in the regex. The +following license: + + (GPL-2.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0) AND MIT + +returns: + + W: invalid-license-exception Qt-GPL-exception-1.0) + +Adjust the license_exception_regex to exclude trailing parenthesis. + +Fixes: https://bugzilla.redhat.com/2175241 +--- + rpmlint/checks/TagsCheck.py | 2 +- + .../valid-exception-in-grouping-1.0-1.src.rpm | Bin 0 -> 6615 bytes + test/test_tags.py | 12 ++++++++++++ + 3 files changed, 13 insertions(+), 1 deletion(-) + create mode 100644 test/source/valid-exception-in-grouping-1.0-1.src.rpm + +diff --git a/rpmlint/checks/TagsCheck.py b/rpmlint/checks/TagsCheck.py +index ad9a35f2..923538ba 100644 +--- a/rpmlint/checks/TagsCheck.py ++++ b/rpmlint/checks/TagsCheck.py +@@ -21,7 +21,7 @@ lib_package_regex = re.compile(r'(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', + leading_space_regex = re.compile(r'^\s+') + pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/') + license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s') +-license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s(\S+)') ++license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s([^)]+)') + invalid_version_regex = re.compile(r'([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) + # () are here for grouping purpose in the regexp + tag_regex = re.compile(r'^((?:Auto(?:Req|Prov|ReqProv)|Build(?:Arch(?:itectures)?|Root)|(?:Build)?Conflicts|(?:Build)?(?:Pre)?Requires|Copyright|(?:CVS|SVN)Id|Dist(?:ribution|Tag|URL)|DocDir|(?:Build)?Enhances|Epoch|Exclu(?:de|sive)(?:Arch|OS)|Group|Icon|License|Name|No(?:Patch|Source)|Obsoletes|Packager|Patch\d*|Prefix(?:es)?|Provides|(?:Build)?Recommends|Release|RHNPlatform|Serial|Source\d*|(?:Build)?Suggests|Summary|(?:Build)?Supplements|(?:Bug)?URL|Vendor|Version)(?:\([^)]+\))?:)\s*\S', re.IGNORECASE) +diff --git a/test/source/valid-exception-in-grouping-1.0-1.src.rpm b/test/source/valid-exception-in-grouping-1.0-1.src.rpm +new file mode 100644 +index 0000000000000000000000000000000000000000..c74b2f048a8d45b224df143f7a77f75d21eba87c +GIT binary patch +literal 6615 +zcmeI0d2AF_9LL`tYB?^B-%10R)j40whud2@sEvN(e{fwp7bu1rdSz`?U{56EX2$capc?{mk$8uHT!T +zO}@?RE*$j{;vt@?RwPUVtj1x9R5%_Bgkyoqs(5uG9IFh3f?^;<{`K;Z`~IHu)`mt8 +zzxMzknOop{E;RgJ2bu{}cLBX08eWj==?02Cw4Hs8pnhl(&Od=df0BR({e2ffG5#7f +z=0>O><#FLNZ2X)5L=W4w;@L>^zu8P5Up_i?76xW4_I8Ru^}yPUCJu)l}i1I6(VbN-UYv3?jo +z1B&CH;(Qhq@_kvH&$q{YLy+^yJ^W4rekTc$3YJU>ZoEn;4LdBBWJ1cS6sCn!lLRX! +z+%Zapa7?g-+g9m+>IA<4>Qy#H<5h`C;TQ|1SUhIMEXPVkf-#nY_2QB@RQ!2cC{58I +z8B#Q+G$4UD8;?b%3uR-4zwr2yiejNW6~LQ!R*P2dP+`>Q0^x~q1pzsbAF-;Fj8w!a +z6`rk*M8NH3RYFcGIwLO;x8pTICmziuMOKt0$)r>&k<1=3g4I~jM1*08K!@rYQe$W@ +zXv*z%*4DM{XLX2$43(KwQcT-6Ma6Yw$5v%ma&%GBsVkX^tDDS}R9m*0?nunF3`eDs +zEXk@ZiS6SN0Tx5B!TYiGUZ(~RK}T#=iD)Ej56O>56ICpkWVA3GVWV*iLkW-Joq}*B +z95CFIgJMtte_IJ^Z9caW4Cz6zyQ$}7-ne*_31u-RMRUAq)I* +znOeO18DdDcWs@nkLJbQ}&$1O6z|=z;(;QWnMb)xI$xAG +z)&9rT+IjyI~m +zI<4P=#ixevY{(e&(PCwPgVICVT>WM(yE1)N;PA<}A34)oUcI;DHb*|?ESzvLYgN;! +zf!&V`-b8BmvSiuRHN6+qe3dbHLSe6U^ZM3D2cK9| +zxwGlSxr-h0mkOP;b}j!pFzE8;ik7~OlRs$~pnN}9oV9oH&nFfY6%RjPpKWdFfA#Fm +f-9H}c^;`3rX{W~zTe@S*l@7<2XFs +Date: Mon, 20 Mar 2023 03:14:14 -0400 +Subject: [PATCH] TagsCheck: restore space exclusion to license_exception_regex + +In 7d707f7f (TagsCheck: handle license exception in grouping, +2023-03-03), the regex lost the exclusion of space characters. This +isn't immediately noticeable because we strip the strings generated by +the regex before use, but it's better to keep the regex more precise. + +Suggested-by: Daniel Garcia Moreno +--- + rpmlint/checks/TagsCheck.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rpmlint/checks/TagsCheck.py b/rpmlint/checks/TagsCheck.py +index 923538ba..65c75c92 100644 +--- a/rpmlint/checks/TagsCheck.py ++++ b/rpmlint/checks/TagsCheck.py +@@ -21,7 +21,7 @@ + leading_space_regex = re.compile(r'^\s+') + pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/') + license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s') +-license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s([^)]+)') ++license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s([^)\s]+)') + invalid_version_regex = re.compile(r'([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) + # () are here for grouping purpose in the regexp + tag_regex = re.compile(r'^((?:Auto(?:Req|Prov|ReqProv)|Build(?:Arch(?:itectures)?|Root)|(?:Build)?Conflicts|(?:Build)?(?:Pre)?Requires|Copyright|(?:CVS|SVN)Id|Dist(?:ribution|Tag|URL)|DocDir|(?:Build)?Enhances|Epoch|Exclu(?:de|sive)(?:Arch|OS)|Group|Icon|License|Name|No(?:Patch|Source)|Obsoletes|Packager|Patch\d*|Prefix(?:es)?|Provides|(?:Build)?Recommends|Release|RHNPlatform|Serial|Source\d*|(?:Build)?Suggests|Summary|(?:Build)?Supplements|(?:Bug)?URL|Vendor|Version)(?:\([^)]+\))?:)\s*\S', re.IGNORECASE) diff --git a/0001-fix-broken-regex-for-no-manual-page-for-binary-check.patch b/0001-fix-broken-regex-for-no-manual-page-for-binary-check.patch new file mode 100644 index 0000000..2a7e217 --- /dev/null +++ b/0001-fix-broken-regex-for-no-manual-page-for-binary-check.patch @@ -0,0 +1,56 @@ +From 393cde4e70a6efdf1353ca1d4a8ba6500c0dc967 Mon Sep 17 00:00:00 2001 +From: Martin Liska +Date: Sat, 8 Oct 2022 10:12:54 +0200 +Subject: [PATCH] fix broken regex for no-manual-page-for-binary check + +It was a regression since 718e1eb9e6e84edf34026f2b62653f3d8f75d993. + +Fixes: #918. +--- + rpmlint/checks/FilesCheck.py | 6 +++--- + test/test_files.py | 1 + + 2 files changed, 4 insertions(+), 3 deletions(-) + +diff --git a/rpmlint/checks/FilesCheck.py b/rpmlint/checks/FilesCheck.py +index 067e603d..cbd32259 100644 +--- a/rpmlint/checks/FilesCheck.py ++++ b/rpmlint/checks/FilesCheck.py +@@ -204,7 +204,7 @@ + non_readable_regexs = (re.compile(r'^/var/log/'), + re.compile(r'^/etc/(g?shadow-?|securetty)$')) + +-man_base_regex = re.compile(r'^/usr(?:/share)?/man(?:/overrides)?/man(?P[^/]+)/(?P.+)') ++man_base_regex = re.compile(r'^/usr(?:/share)?/man(?:/overrides)?/man(?P[^/]+)/(?P((?P[^.]+)\..+))') + + fsf_license_regex = re.compile(br'(GNU((\s+(Library|Lesser|Affero))?(\s+General)?\s+Public|\s+Free\s+Documentation)\s+Licen[cs]e|(GP|FD)L)', re.IGNORECASE) + fsf_wrong_address_regex = re.compile(br'(675\s+Mass\s+Ave|59\s+Temple\s+Place|Franklin\s+Steet|02139|02111-1307)', re.IGNORECASE) +@@ -702,7 +702,7 @@ def check(self, pkg): + # look for man pages + res = man_base_regex.fullmatch(f) + if res: +- man_basenames.add(res.group('category')) ++ man_basenames.add(res.group('binary')) + + res = bin_regex.search(f) + if res: +@@ -924,7 +924,7 @@ def check(self, pkg): + + res = man_base_regex.fullmatch(f) + if res: +- man_basenames.add(res.group('category')) ++ man_basenames.add(res.group('binary')) + else: + res = bin_regex.search(f) + if res: +diff --git a/test/test_files.py b/test/test_files.py +index 09fae39f..684a39b6 100644 +--- a/test/test_files.py ++++ b/test/test_files.py +@@ -175,6 +175,7 @@ def test_distribution_tags(tmpdir, package, filescheck): + test.check(get_tested_package(package, tmpdir)) + out = output.print_results(output.results) + assert 'manpage-not-compressed' in out ++ assert 'no-manual-page-for-binary' not in out + assert 'This manual page is not compressed with the bz2 compression' in out + + diff --git a/0002-TagsCheck-handle-license-exception-in-first-item-of-.patch b/0002-TagsCheck-handle-license-exception-in-first-item-of-.patch new file mode 100644 index 0000000..b23d36f --- /dev/null +++ b/0002-TagsCheck-handle-license-exception-in-first-item-of-.patch @@ -0,0 +1,97 @@ +From 65abdbd383166ce727ece30f79b0808f46c2da29 Mon Sep 17 00:00:00 2001 +From: Todd Zullinger +Date: Mon, 20 Mar 2023 03:20:44 -0400 +Subject: [PATCH] TagsCheck: handle license exception in first item of a + grouping + +The change in 7d707f7f (TagsCheck: handle license exception in grouping, +2023-03-03) is insufficient when the exception is on the first item in a +grouping, e.g.: + + License: (Apache-2.0 WITH LLVM-exception OR NCSA) AND BSD-3-Clause + +Adjust `license_exception_regex` to exclude a leading '(' as well as a +trailing ')'. +--- + rpmlint/checks/TagsCheck.py | 2 +- + .../valid-exception-begin-grouping-1.0-1.src.rpm | Bin 0 -> 6644 bytes + test/test_tags.py | 12 ++++++++++++ + 3 files changed, 13 insertions(+), 1 deletion(-) + create mode 100644 test/source/valid-exception-begin-grouping-1.0-1.src.rpm + +diff --git a/rpmlint/checks/TagsCheck.py b/rpmlint/checks/TagsCheck.py +index 65c75c92..64088f55 100644 +--- a/rpmlint/checks/TagsCheck.py ++++ b/rpmlint/checks/TagsCheck.py +@@ -21,7 +21,7 @@ + leading_space_regex = re.compile(r'^\s+') + pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/') + license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s') +-license_exception_regex = re.compile(r'(\S+)\s(?:WITH|with)\s([^)\s]+)') ++license_exception_regex = re.compile(r'([^(\s]+)\s(?:WITH|with)\s([^)\s]+)') + invalid_version_regex = re.compile(r'([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) + # () are here for grouping purpose in the regexp + tag_regex = re.compile(r'^((?:Auto(?:Req|Prov|ReqProv)|Build(?:Arch(?:itectures)?|Root)|(?:Build)?Conflicts|(?:Build)?(?:Pre)?Requires|Copyright|(?:CVS|SVN)Id|Dist(?:ribution|Tag|URL)|DocDir|(?:Build)?Enhances|Epoch|Exclu(?:de|sive)(?:Arch|OS)|Group|Icon|License|Name|No(?:Patch|Source)|Obsoletes|Packager|Patch\d*|Prefix(?:es)?|Provides|(?:Build)?Recommends|Release|RHNPlatform|Serial|Source\d*|(?:Build)?Suggests|Summary|(?:Build)?Supplements|(?:Bug)?URL|Vendor|Version)(?:\([^)]+\))?:)\s*\S', re.IGNORECASE) +diff --git a/test/source/valid-exception-begin-grouping-1.0-1.src.rpm b/test/source/valid-exception-begin-grouping-1.0-1.src.rpm +new file mode 100644 +index 0000000000000000000000000000000000000000..d0aba4903debd79db253b7655f3a001f2edfe0b2 +GIT binary patch +literal 6644 +zcmeI0X>3$g6vyv$3f3aFEV78;Lm+IK;q6OBs1%_PECOW_i}IHHrlYf^^Qr?V`=X#k +z!y+0!ARz{1u?UI;(1I2aF%Y7H0*L|z1leR&YwJ1f1&N9H#c$3_PXF)s&Rx&DeUtpp +ztv-L)Pl%8Bo;M?5CqPp+O?csWEMU=4I2H(%#mf`nSSTO_`G7#~eECSDzc-k__Oy>Z +zyNi(Ajd0%w0`FIV=EBrXK^sHh1#NxJK#{vQu>Uk@CPaks&!EtsBp{%_{{krHr$Rt~ +z|3y&D&xAB5Qd^>uVJNn!nX)7cifh{%6?jm^po&99jmk151~pBWw+&s;ZR%*YVGD}o +z2vl=aNpMBpRe8(SWSiGy)#6Rc^NOG;)U-^^q@ruXgoI?3R0xNCyC+vK%R3uLG!s62 +zlaP$9^{MoqbOq8CNLL_Tfpi7Z6-ZYgU4e83(iKQoAYFlU1=1DxzgM8%6RE4KdmRb^ +zo(3Ve`6dc@8jIjjUkLCu{Ifu@jRTPdffxE7=#!vtlEL^V#vK`-Vcdl=`Y3lpbY*;w +zag_0SQ1n&Mv%&GvXTkA5W_$@0^ItQ*42tGI4ISvJxzhdqXZ`oDGWYJ;qHyp?qe;MOK#w!>P0>%C-84qXqHH^nFu3-Em +zD7N3o7~d0)f3sfWSiX|wpJsf5u>*?ht7c3Y<2l9sxQy}K0k>EHisNIwkax2D4aPVw +zt_RNv=5btT@6Tt9=MeJ#{>TO7&VDBWzmo{0m?k~WjhAsl!ZwX1Dd(9X?uD>d%9%0l +zmRHJ|9_N)(uHG_@fm_POUC!igdZ+)*C_&=1uG$xkmnBNWF&gw}JZ8pB+w>yA81-OJ +zxUE&ie?8`gcutUX8~DVKfC%PoJQkV2jUH57$PM!X`0&>9(cA6LJzCVC>o=l*KnfH@ +z%LVaUcPOGG1Kt6M=lnkb{mBy|RaBeV#& +z(VegyKItD0!CQxCQjibIV0z0zwch-egMtYyOCMlyXC3l@yLgP|-&TP> +zT!3rv%L80E7WTqsgiDzAb7qK=e|mwOplXJw8H%bkY!R1TABcFLb-M+B=RF6L32GB! +zC&FTnqga(MioWW4NGw(Lr`p0 +zvMh_Ls%opINGZ7Gcx4Her0TB3JF;Ucx+qD4Zn>@_+oo$6s-rkAjO=QnZd$r67?LEb +zj_rsPCN~V%;Bk=pAGNx=8vLl_J~$8lKjF&ozczf>&>ej4$<3c0OL4;%%#SV05(c!K +z(fQ@SXWo_1!1WnRLK= +zs`k>FZC5J-*QSrYxXtQ(YU$!WT}C}y6>3>nHKRE6O7S$i`7b>e?a8vwRNgyf^!l!Y +zAMX(CQ8KVXcx(~c_TJ2i0Ztm`dug;oPWOjRL`0PrH#1G7#nw=fUZ=!ZSRQO&= +z(<>Rd+0knw$L;TM<-(jJ$;^X2#%{knexg5T@%uBj)Lw3!^UlL(wpXv%)vl(;j=i~) +z9?1E!prABrM~Y6&t?a^4fmv1(Z=ST3inUh +sK6Om(sO2?NYCrpALSNx`_1)v=$EO}yH){1}ue!y_!= 5.05 needed - _magic.load() --except: -+except ImportError: - _magic = None - import rpm - -@@ -52,7 +52,7 @@ else: - - try: - from shlex import quote as shquote --except: -+except ImportError: - def shquote(s): - return '"%s"' % s - -@@ -166,7 +166,7 @@ def is_utf8(fname): - def is_utf8_bytestr(s): - try: - s.decode('UTF-8') -- except: -+ except UnicodeError: - return False - return True - -@@ -227,7 +227,7 @@ def get_default_valid_rpmgroups(filename - groupsfiles = [x for x in p.files() if x.endswith('/GROUPS')] - if groupsfiles: - filename = groupsfiles[0] -- except: # the rpm package might not be installed -+ except KeyError: # the rpm package might not be installed - pass - if filename and os.path.exists(filename): - with open(filename) as fobj: -@@ -532,7 +532,7 @@ class Pkg(AbstractPkg): - def __getitem__(self, key): - try: - val = self.header[key] -- except: -+ except KeyError: - val = [] - if val == []: - return None -@@ -680,7 +680,7 @@ class Pkg(AbstractPkg): - magics = [b2s(x) for x in self.header[rpm.RPMTAG_FILECLASS]] - try: # rpm >= 4.7.0 - filecaps = self.header[rpm.RPMTAG_FILECAPS] -- except: -+ except AttributeError: - filecaps = None - - # rpm-python < 4.6 does not return a list for this (or FILEDEVICES, -@@ -915,9 +915,11 @@ class Pkg(AbstractPkg): - Depending on rpm-python version, the string may or may not include - interpreter arguments, if any. - """ -+ if which is None: -+ return '' - prog = self[which] - if prog is None: -- prog = "" -+ prog = '' - elif isinstance(prog, (list, tuple)): - # http://rpm.org/ticket/847#comment:2 - prog = "".join(prog) -diff -up rpmlint-rpmlint-1.10/rpmlint.flake rpmlint-rpmlint-1.10/rpmlint ---- rpmlint-rpmlint-1.10/rpmlint.flake 2017-09-05 02:40:05.000000000 -0400 -+++ rpmlint-rpmlint-1.10/rpmlint 2018-04-17 12:22:20.682609674 -0400 -@@ -20,7 +20,7 @@ import tempfile - - try: - import importlib --except: # Python < 2.7 -+except ImportError: # Python < 2.7 - importlib = None - import imp - -diff -up rpmlint-rpmlint-1.10/SCLCheck.py.flake rpmlint-rpmlint-1.10/SCLCheck.py ---- rpmlint-rpmlint-1.10/SCLCheck.py.flake 2017-09-05 02:40:05.000000000 -0400 -+++ rpmlint-rpmlint-1.10/SCLCheck.py 2018-04-17 12:22:20.682609674 -0400 -@@ -50,7 +50,7 @@ def index_or_sub(source, word, sub=0): - """ - try: - return source.index(word) -- except: -+ except ValueError: - return sub - - -diff -up rpmlint-rpmlint-1.10/SpecCheck.py.flake rpmlint-rpmlint-1.10/SpecCheck.py ---- rpmlint-rpmlint-1.10/SpecCheck.py.flake 2017-09-05 02:40:05.000000000 -0400 -+++ rpmlint-rpmlint-1.10/SpecCheck.py 2018-04-17 12:22:20.682609674 -0400 -@@ -571,7 +571,7 @@ class SpecCheck(AbstractCheck.AbstractCh - try: - ts = rpm.TransactionSet() - spec_obj = ts.parseSpec(self._spec_file) -- except: -+ except rpm.error: - # errors logged above already - pass - if spec_obj: -diff -up rpmlint-rpmlint-1.10/ZipCheck.py.flake rpmlint-rpmlint-1.10/ZipCheck.py ---- rpmlint-rpmlint-1.10/ZipCheck.py.flake 2017-09-05 02:40:05.000000000 -0400 -+++ rpmlint-rpmlint-1.10/ZipCheck.py 2018-04-17 12:22:20.682609674 -0400 -@@ -43,6 +43,10 @@ class ZipCheck(AbstractCheck.AbstractChe - badcrc = z.testzip() - if badcrc: - printError(pkg, 'bad-crc-in-zip', badcrc, fname) -+ except zipfile.error: -+ printWarning(pkg, 'unable-to-read-zip', '%s: %s' % -+ (fname, sys.exc_info()[1])) -+ else: - compressed = False - for zinfo in z.infolist(): - if zinfo.compress_type != zipfile.ZIP_STORED: -@@ -70,9 +74,6 @@ class ZipCheck(AbstractCheck.AbstractChe - if want_indexed_jars: - printWarning(pkg, 'jar-not-indexed', fname) - pass -- except: -- printWarning(pkg, 'unable-to-read-zip', '%s: %s' % -- (fname, sys.exc_info()[1])) - - z and z.close() - diff --git a/rpmlint-1.10-ignore-debuginfo-useless-provides.patch b/rpmlint-1.10-ignore-debuginfo-useless-provides.patch deleted file mode 100644 index 8a97bdc..0000000 --- a/rpmlint-1.10-ignore-debuginfo-useless-provides.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 7f86c79068be1c83303da30f5f4f030080e6326a Mon Sep 17 00:00:00 2001 -From: Dirk Mueller -Date: Sat, 4 Nov 2017 02:24:30 +0100 -Subject: [PATCH] Ignore useless-provides on debuginfo provides (#112) - -Also flip to set's rather than lists as the main operation -here is lookup, so set()s should be faster. ---- - TagsCheck.py | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/TagsCheck.py b/TagsCheck.py -index a8d87aa..dc890b1 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -823,11 +823,13 @@ class TagsCheck(AbstractCheck.AbstractCheck): - - # TODO: should take versions, <, <=, =, >=, > into account here - # https://bugzilla.redhat.com/460872 -- useless_provides = [] -+ useless_provides = set() - for p in prov_names: -- if prov_names.count(p) != 1 and p not in useless_provides: -- useless_provides.append(p) -- for p in useless_provides: -+ if (prov_names.count(p) != 1 and -+ not p.startswith('debuginfo(') and -+ p not in useless_provides): -+ useless_provides.add(p) -+ for p in sorted(useless_provides): - printError(pkg, 'useless-provides', p) - - for p in pkg.provides(): --- -2.17.0 - diff --git a/rpmlint-1.10-missing-files-exception.patch b/rpmlint-1.10-missing-files-exception.patch deleted file mode 100644 index 80935c1..0000000 --- a/rpmlint-1.10-missing-files-exception.patch +++ /dev/null @@ -1,44 +0,0 @@ -From 3a072351314c3a3ec11650ad8efd2fc6ececf987 Mon Sep 17 00:00:00 2001 -From: Dirk Mueller -Date: Sat, 4 Nov 2017 02:17:52 +0100 -Subject: [PATCH] Properly handle the exception on missing files - -Missing files raises a FileNotFoundError, not OSError. Also -simplify logic. - -(cherry picked from commit d59bc2a1e2698040553c09610cb2befa1ef8d76a) ---- - Pkg.py | 11 +++-------- - 1 file changed, 3 insertions(+), 8 deletions(-) - -diff --git a/Pkg.py b/Pkg.py -index e257243..01d0289 100644 ---- a/Pkg.py -+++ b/Pkg.py -@@ -714,20 +714,15 @@ class Pkg(AbstractPkg): - pkgfile.magic = "symbolic link to `%s'" % pkgfile.linkto - elif not pkgfile.size: - pkgfile.magic = 'empty' -- if not pkgfile.magic and _magic: -+ if (not pkgfile.magic and -+ not pkgfile.is_ghost and _magic): - # file() method evaluates every file twice with python2, - # use descriptor() method instead - try: - fd = os.open(pkgfile.path, os.O_RDONLY) -- except OSError: -- if not pkgfile.is_ghost: -- raise -- else: - pkgfile.magic = b2s(_magic.descriptor(fd)) -- # libmagic up to 5.18 already closes the descriptor -- try: - os.close(fd) -- except OSError: -+ except FileNotFoundError: - pass - if pkgfile.magic is None: - pkgfile.magic = '' --- -2.17.0 - diff --git a/rpmlint-1.10-py37magic.patch b/rpmlint-1.10-py37magic.patch deleted file mode 100644 index 8986a38..0000000 --- a/rpmlint-1.10-py37magic.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/FilesCheck.py b/FilesCheck.py -index c8666b9..78b22ef 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -331,7 +331,7 @@ def peek(filename, pkg, length=1024): - '3.4': [3310], - '3.5': [3350, 3351], # 3350 for < 3.5.2 - '3.6': [3379], -- '3.7': [3390], -+ '3.7': [3390, 3391, 3392, 3393, 3394], - } - - diff --git a/rpmlint-1.10-py37mtime.patch b/rpmlint-1.10-py37mtime.patch deleted file mode 100644 index ded068d..0000000 --- a/rpmlint-1.10-py37mtime.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff -up rpmlint-rpmlint-1.10/FilesCheck.py.py37mtime rpmlint-rpmlint-1.10/FilesCheck.py ---- rpmlint-rpmlint-1.10/FilesCheck.py.py37mtime 2018-06-02 14:29:53.035453468 -0400 -+++ rpmlint-rpmlint-1.10/FilesCheck.py 2018-06-02 14:32:55.430860108 -0400 -@@ -377,6 +377,27 @@ def py_demarshal_long(b): - return (b[0] + (b[1] << 8) + (b[2] << 16) + (b[3] << 24)) - - -+def pyc_magic_from_chunk(chunk): -+ """From given chunk (beginning of the file), return Python magic number""" -+ return py_demarshal_long(chunk[:4]) & 0xffff -+ -+ -+def pyc_mtime_from_chunk(chunk): -+ """From given chunk (beginning of the file), return mtime or None -+ -+ From Python 3.7, mtime is not always present. -+ -+ See https://www.python.org/dev/peps/pep-0552/#specification -+ """ -+ magic = pyc_magic_from_chunk(chunk) -+ second = py_demarshal_long(chunk[4:8]) -+ if magic >= _python_magic_values['3.7'][0]: -+ if second == 0: -+ return py_demarshal_long(chunk[8:12]) -+ return None # No mtime saved, TODO check hashes instead -+ return second -+ -+ - def python_bytecode_to_script(path): - """ - Given a python bytecode path, give the path of the .py file -@@ -729,7 +750,7 @@ class FilesCheck(AbstractCheck.AbstractC - if chunk: - # Verify that the magic ABI value embedded in the - # .pyc header is correct -- found_magic = py_demarshal_long(chunk[:4]) & 0xffff -+ found_magic = pyc_magic_from_chunk(chunk) - exp_magic, exp_version = get_expected_pyc_magic(f) - if exp_magic and found_magic not in exp_magic: - found_version = 'unknown' -@@ -752,13 +773,14 @@ class FilesCheck(AbstractCheck.AbstractC - - # Verify that the timestamp embedded in the .pyc - # header matches the mtime of the .py file: -- pyc_timestamp = py_demarshal_long(chunk[4:8]) -+ pyc_timestamp = pyc_mtime_from_chunk(chunk) - # If it's a symlink, check target file mtime. - srcfile = pkg.readlink(files[source_file]) - if not srcfile: - printWarning( - pkg, 'python-bytecode-without-source', f) -- elif pyc_timestamp != srcfile.mtime: -+ elif (pyc_timestamp is not None and -+ pyc_timestamp != srcfile.mtime): - cts = datetime.fromtimestamp( - pyc_timestamp).isoformat() - sts = datetime.fromtimestamp( diff --git a/rpmlint-1.10-ugly-workaroud-for-RPM-4.14-vs-4.15-python3-bindings-incompatibility.patch b/rpmlint-1.10-ugly-workaroud-for-RPM-4.14-vs-4.15-python3-bindings-incompatibility.patch deleted file mode 100644 index 46a4a2e..0000000 --- a/rpmlint-1.10-ugly-workaroud-for-RPM-4.14-vs-4.15-python3-bindings-incompatibility.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 8fd904b53c028dded0b308ee95f1a5ff998584fd Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= -Date: Thu, 4 Jul 2019 00:31:49 +0200 -Subject: [PATCH] Ugly workaround for RPM 4.14 vs 4.15 python3 bindings - incompatibility - -Fixes https://github.com/rpm-software-management/rpmlint/issues/202 ---- - Pkg.py | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/Pkg.py b/Pkg.py -index 8cf701c..4c96098 100644 ---- a/Pkg.py -+++ b/Pkg.py -@@ -164,8 +164,17 @@ def is_utf8(fname): - - - def is_utf8_bytestr(s): -+ """Returns True whether the given text is UTF-8. -+ Due to changes in rpm, needs to handle both bytes and unicode.""" - try: -- s.decode('UTF-8') -+ if hasattr(s, 'decode'): -+ s.decode('utf-8') -+ elif hasattr(s, 'encode'): -+ s.encode('utf-8') -+ else: -+ unexpected = type(s).__name__ -+ raise TypeError( -+ 'Expected str/unicode/bytes, not {}'.format(unexpected)) - except UnicodeError: - return False - return True --- -2.23.0 - diff --git a/rpmlint-1.10.tar.gz b/rpmlint-1.10.tar.gz deleted file mode 100644 index cf7aa77..0000000 Binary files a/rpmlint-1.10.tar.gz and /dev/null differ diff --git a/rpmlint-2.4.0.tar.gz b/rpmlint-2.4.0.tar.gz new file mode 100644 index 0000000..7be7200 Binary files /dev/null and b/rpmlint-2.4.0.tar.gz differ diff --git a/rpmlint-etc.config b/rpmlint-etc.config deleted file mode 100644 index 5f670ac..0000000 --- a/rpmlint-etc.config +++ /dev/null @@ -1,2 +0,0 @@ -# Add local system wide rpmlint configuration here or in other *config files -# in this directory. diff --git a/rpmlint.config b/rpmlint.config deleted file mode 100644 index acb9e0e..0000000 --- a/rpmlint.config +++ /dev/null @@ -1,471 +0,0 @@ -# -*- python -*- - -# System wide rpmlint default configuration. Do not modify, override/add -# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed. - -import os.path -import re -import sys - -from Config import * -import Pkg - - -setOption("CompressExtension", "gz") -setOption("DefaultPythonVersion", sys.version[:3]) -setOption("KernelModuleRPMsOK", False) -setOption("MaxLineLength", 80) -setOption("NetworkEnabled", True) -setOption("ReleaseExtension", r'\.(fc|rhe?l|el)\d+(?=\.|$)') -setOption("UseDebugSource", True) -setOption("UseDefaultRunlevels", False) -setOption("UseEpoch", False) -setOption("UseUTF8", True) -setOption("UseVersionInChangeLog", True) -setOption("ValidSrcPerms", (int("664",8), int("644",8), )) -setOption("ValidGroups", []) - -setOption("ValidShells", ( - "", - "/bin/sh", - "/bin/bash", - "/sbin/ldconfig", - "/usr/bin/perl", - "/usr/bin/python", -)) - -setOption("DanglingSymlinkExceptions", ( - ['consolehelper$', 'usermode'], - ['consolehelper-gtk$', 'usermode-gtk'], -)) - -setOption("ValidLicenses", ( - 'AAL', - 'Abstyles', - 'Adobe', - 'ADSL', - 'AFL', - 'Afmparse', - 'AGPLv1', - 'AGPLv3', - 'AGPLv3+', - 'AGPLv3 with exceptions', - 'AMDPLPA', - 'AML', - 'AMPAS BSD', - 'APAFML', - 'App-s2p', - 'APSL 2.0', - 'APSL 2.0+', - 'ARL', - 'Artistic 2.0', - 'Artistic clarified', - 'ASL 1.0', - 'ASL 1.0+', - 'ASL 1.1', - 'ASL 1.1+', - 'ASL 2.0', - 'ASL 2.0+', - 'Bahyph', - 'Barr', - 'Beerware', - 'BeOpen', - 'Bibtex', - 'BitTorrent', - 'Boost', - 'Borceux', - 'BSD', - 'BSD Protection', - 'BSD with advertising', - 'BSD with attribution', - 'CATOSL', - 'CC0', - 'CeCILL', - 'CeCILL-B', - 'CeCILL-C', - 'CDDL', - 'CNRI', - 'Condor', - 'Copyright only', - 'CPAL', - 'CPL', - 'CRC32', - 'Crossword', - 'Crystal Stacker', - 'Cube', - 'diffmark', - 'DMIT', - 'DOC', - 'Dotseqn', - 'DSDP', - 'dvipdfm', - 'DWPL', - 'ECL 1.0', - 'ECL 2.0', - 'eCos', - 'EFL 2.0', - 'EFL 2.0+', - 'eGenix', - 'Entessa', - 'EPICS', - 'EPL', - 'ERPL', - 'EU Datagrid', - 'EUPL 1.1', - 'Eurosym', - 'Fair', - 'FSFUL', - 'FSFULLR', - 'FTL', - 'Giftware', - 'GL2PS', - 'Glide', - 'Glulxe', - 'gnuplot', - 'GPL+', - 'GPL+ or Artistic', - 'GPL+ with exceptions', - 'GPLv1', - 'GPLv2 or Artistic', - 'GPLv2+ or Artistic', - 'GPLv2', - 'GPLv2 with exceptions', - 'GPLv2+', - 'GPLv2+ with exceptions', - 'GPLv3', - 'GPLv3 with exceptions', - 'GPLv3+', - 'GPLv3+ with exceptions', - 'HaskellReport', - 'HSRL', - 'IBM', - 'IJG', - 'ImageMagick', - 'iMatix', - 'Imlib2', - 'Intel ACPI', - 'Interbase', - 'ISC', - 'Jabber', - 'JasPer', - 'JPython', - 'Julius', - 'Knuth', - 'Latex2e', - 'LBNL BSD', - 'Leptonica', - 'LGPLv2', - 'LGPLv2 with exceptions', - 'LGPLv2+', - 'LGPLv2+ or Artistic', - 'LGPLv2+ with exceptions', - 'LGPLv3', - 'LGPLv3 with exceptions', - 'LGPLv3+', - 'LGPLv3+ with exceptions', - 'Lhcyr', - 'libtiff', - 'LLGPL', - 'Logica', - 'LOSLA', - 'LPL', - 'LPPL', - 'MakeIndex', - 'mecab-ipadic', - 'midnight', - 'MirOS', - 'MIT', - 'MITNFA', - 'MIT with advertising', - 'mod_macro', - 'Motosoto', - 'MPLv1.0', - 'MPLv1.0+', - 'MPLv1.1', - 'MPLv1.1+', - 'MPLv2.0', - 'MS-PL', - 'MS-RL', - 'MTLL', - 'Mup', - 'Naumen', - 'NCSA', - 'NetCDF', - 'Netscape', - 'Newmat', - 'Newsletr', - 'NGPL', - 'NLPL', - 'Nmap', - 'Nokia', - 'NOSL', - 'Noweb', - 'OGL', - 'OML', - 'OpenLDAP', - 'OpenPBS', - 'OpenSSL', - 'OReilly', - 'OSL 1.0', - 'OSL 1.0+', - 'OSL 1.1', - 'OSL 1.1+', - 'OSL 2.0', - 'OSL 2.0+', - 'OSL 2.1', - 'OSL 2.1+', - 'OSL 3.0', - 'OSL 3.0+', - 'Par', - 'Phorum', - 'PHP', - 'PlainTeX', - 'Plexus', - 'PostgreSQL', - 'psfrag', - 'psutils', - 'Public Domain', - 'Python', - 'Qhull', - 'QPL', - 'Rdisc', - 'REX', - 'RiceBSD', - 'Romio', - 'RPSL', - 'Rsfs', - 'Ruby', - 'Saxpath', - 'SCEA', - 'SCRIP', - 'Sendmail', - 'Sleepycat', - 'SISSL', - 'SLIB', - 'SNIA', - 'softSurfer', - 'SPL', - 'STMPL', - 'SWL', - 'TCGL', - 'TCL', - 'Teeworlds', - 'TGPPL', - 'TGPPL with exceptions', - 'Threeparttable', - 'TMate', - 'Tolua', - 'TORQUEv1.1', - 'TOSL', - 'TPDL', - 'TPL', - 'TTWL', - 'UCAR', - 'UCD', - 'Unicode', - 'Unlicense', - 'Vim', - 'VNLSL', - 'VOSTROM', - 'VSL', - 'W3C', - 'Webmin', - 'Wsuipa', - 'WTFPL', - 'wxWidgets', - 'Xerox', - 'xinetd', - 'xpp', - 'XSkat', - 'YPLv1.1', - 'Zed', - 'Zend', - 'zlib', - 'zlib with acknowledgement', - 'ZPLv1.0', - 'ZPLv1.0+', - 'ZPLv2.0', - 'ZPLv2.0+', - 'ZPLv2.1', - 'ZPLv2.1+', - # Documentation licenses - 'CDL', - 'FBSDDL', - 'GFDL', - 'IEEE', - 'LDPL', - 'OFSFDL', - 'Open Publication', - 'Public Use', - 'Verbatim', - # Content licenses - 'CC-BY', - 'CC-BY-ND', - 'CC-BY-SA', - 'DMTF', - 'DSL', - 'EFML', - 'Free Art', - 'GeoGratis', - 'Green OpenMusic', - 'OAL', - # Font licenses - 'AMS', - 'Arphic', - 'Baekmuk', - 'Bitstream Vera', - 'DoubleStroke', - 'Hershey', - 'IPA', - 'Liberation', - 'Lucida', - 'MgOpen', - 'mplus', - 'OFL', - 'PTFL', - 'STIX', - 'Utopia', - 'Wadalab', - 'XANO', - # Others - 'Redistributable, no modification permitted', - 'Freely redistributable without restriction', -)) - -setOption('SystemLibPaths', ('/lib', '/lib64', '/usr/lib', '/usr/lib64')) - -# Add systemd dir to ignored path for UsrLibBinaryException -setOption('UsrLibBinaryException', r'^/usr/lib(64)?/(perl|python|ruby|menu|pkgconfig|ocaml|systemd|lib[^/]+\.(so|l?a)$|\.build-id)') - -# Get standard users and groups from the setup package's uidgid file -setOption('StandardUsers', []) -setOption('StandardGroups', []) -setup_pkg = None -try: - setup_pkg = Pkg.InstalledPkg('setup') -except: - pass -if setup_pkg: - users = set() - groups = set() - uidgid_regex = re.compile(r'^\s*(\S+)\s+(-|\d+)\s+(-|\d+|\(\d+\))\s') - for uidgid_file in [x for x in setup_pkg.files() if x.endswith('/uidgid')]: - if os.path.exists(uidgid_file): - fobj = open(uidgid_file) - try: - for line in fobj.read().strip().splitlines(): - res = uidgid_regex.search(line) - if res: - name = res.group(1) - if res.group(2) != '-': - users.add(name) - if res.group(3) != '-' and not '(' in res.group(3): - groups.add(name) - del res - del line - finally: - fobj.close() - del fobj - setOption('StandardUsers', sorted(users)) - setOption('StandardGroups', sorted(groups)) - del uidgid_regex, uidgid_file, users, groups -del setup_pkg - -# Output filters -addFilter("source-or-patch-not-compressed") -addFilter("%mklibname") -addFilter("no-dependency-on (perl|python)-base") -addFilter("no-dependency-on locales-") -addFilter("(python|perl5)-naming-policy-not-applied") -addFilter("no-(packager-tag|signature)") -addFilter("incoherent-version-in-name") -addFilter("invalid-build-requires") -addFilter("ghost-files-without-postin") -addFilter("postin-without-ghost-file-creation") -addFilter("no-major-in-name") -addFilter("no-provides") -addFilter("executable-in-library-package") -addFilter("non-versioned-file-in-library-package") -addFilter("requires-on-release") -addFilter("jar-not-indexed") -addFilter("outside-libdir-files") -addFilter("-debug(info|source).* no-documentation") -addFilter("-debuginfo.* /usr/lib/debug/") -addFilter("-debugsource.* /usr/src/debug/") -addFilter("non-standard-dir-in-usr libexec") -addFilter("^gpg-pubkey:") -addFilter(" doc-file-dependency .* /bin/sh$") -addFilter("hardcoded-library-path .*/lib/udev(/|$)") -addFilter("not-standard-release-extension") -addFilter("explicit-lib-dependency (liberation-fonts|libertas-.*-firmware|libvirt$|.*-(java|python)$)") -addFilter("explicit-lib-dependency (python-.*lib.*|python2-.*lib.*|python3-.*lib.*)$") -addFilter("filename-too-long-for-joliet") -addFilter("symlink-should-be-") -addFilter(r"dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$") -addFilter(r"hidden-file-or-dir .*/man5/\.k5login\.5[^/]+$") -addFilter(r"blender.+ (wrong-script-interpreter|non-executable-script) .+/blender/.+\.py.*BPY.*") -addFilter("no-cleaning-of-buildroot") -addFilter("no-buildroot-tag") -addFilter("no-%clean-section") -# Only EL4 needs the files-attr-not-set check, because rpm 4.4 and newer no longer need a %defattr line -# (it automatically provides one). -addFilter("files-attr-not-set") -# Don't bother with the non-ghost-in-run checks, /var/lock and /var/run are -# symlinks to /run/lock and /run respectively, and /run is a tmpfs -addFilter("non-ghost-in-run") -# Someone thought it was a good idea to make .desktop files executable. They were wrong. -# Nevertheless, I do not yet control the universe, so we squelch the error here. -addFilter(r"script-without-shebang .*\.desktop$") -# Some files in /etc/ are not meant to be modified by the sysadmin -addFilter("non-conffile-in-etc /etc/rpm/.*$") -addFilter("non-conffile-in-etc /etc/rc.d/init.d/.*$") -# Fixed in rpm >= 4.7.1 -addFilter("broken-syntax-in-scriptlet-requires") -# Files that are intentionally not supposed to be readable -# Contains passwords -addFilter("non-readable /etc/ovirt-engine/isouploader.conf") -# Ignore webservers which are just broken. -addFilter(r"invalid-url .*\.googlecode\.com/.*HTTP Error 404") -addFilter(r"invalid-url .*\.jboss\.org/.*HTTP Error 403") -addFilter(r"invalid-url .*bitbucket\.org/.*HTTP Error 403") -addFilter(r"invalid-url .*github\.com/.*HTTP Error 403") -# Don't care about long descriptions on debuginfo packages -# They automatically include the package name and are always -# quite long. -addFilter("-debuginfo.* description-line-too-long") -# ignore "common" jargon words -# https://bugzilla.redhat.com/show_bug.cgi?id=1424684#c9 -addFilter(r"spelling-error.* \b(runtime|Runtime|metadata|cryptographic|multi|linux|filesystem|filesystems|backend|backends|userspace|addon|wayland|Wayland|util|utils|lossless|virtualization|toolkits|libvirtd|crypto|glyphs|GStreamer|http|extensibility|codec|codecs|truetype|scalable|pluggable|pixbuf|Kerberos|customizable|bitstream|tcp|libXss|libs|libc|encodings|GLib|udev|posix|libpng|glapi|gbm|freedesktop|spi|realtime|preprocessor|libaudit|hypervisor|embeddable|distributable|devel|config|cairo|bootloader|adaptors|pragma|passphrase|malloc|libvirt|libmagic|io|datetime|boolean|argparse|py|pinentry|namespace|middleware|lowlevel|libxcb|libudev|libsoup|libgcrypt|libcom|iSCSI|initramfs|GObject|executables|dialogs|checkpolicy|bitmapped|assistive)\b") -addFilter("library-without-ldconfig-postin") -addFilter("library-without-ldconfig-postun") - - -bad_crypto_warning = \ -'''This application package calls a function to explicitly set crypto ciphers -for SSL/TLS. That may cause the application not to use the system-wide set -cryptographic policy and should be modified in accordance to: -https://gitee.com/src-openeuler/rpmlint/wikis''' - -call_blacklist = {'crypto-policy-non-compliance-openssl' : - {'f_name' : 'SSL_CTX_set_cipher_list', - 'good_param' : 'PROFILE=SYSTEM', - 'description' : bad_crypto_warning}, - 'crypto-policy-non-compliance-gnutls-1' : - {'f_name' : 'gnutls_priority_set_direct', - 'description' : bad_crypto_warning}, - 'crypto-policy-non-compliance-gnutls-2' : - {'f_name' : 'gnutls_priority_init', - 'good_param' : 'SYSLOG', - 'description' : bad_crypto_warning} - } -setOption("WarnOnFunction", call_blacklist) - -# https://bugzilla.redhat.com/496737, https://bugzilla.redhat.com/646455 -for pkg, exe in (("coreutils", "/bin/su"), - ("krb5-workstation", "/usr/kerberos/bin/ksu"), - ("passwd", "/usr/bin/passwd"), - ("sudo", "/usr/bin/sudo(edit)?"), - ("upstart", "/sbin/initctl"), - ("usermode", "/usr/sbin/userhelper")): - addFilter("%s.* (setuid-binary|non-standard-executable-perm) %s (root )?04" - % (pkg, exe)) diff --git a/rpmlint.spec b/rpmlint.spec index ba9b63d..d024de6 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -1,25 +1,21 @@ %global _python_bytecompile_extra 0 Name: rpmlint -Version: 1.10 -Release: 19 +Version: 2.4.0 +Release: 1 Summary: Check the RPM package of tools for common errors -License: GPLv2 +License: GPL-2.0-or-later URL: https://github.com/rpm-software-management/rpmlint Source0: https://github.com/rpm-software-management/rpmlint/archive/rpmlint-%{version}.tar.gz -Source1: rpmlint.config -Source2: rpmlint-etc.config -Patch0001: rpmlint-1.10-ignore-debuginfo-useless-provides.patch -Patch0002: rpmlint-1.10-flake-cleanups.patch -Patch0003: rpmlint-1.10-missing-files-exception.patch -Patch0004: rpmlint-1.10-py37mtime.patch -Patch0005: rpmlint-1.10-py37magic.patch -Patch0006: rpmlint-1.10-ugly-workaroud-for-RPM-4.14-vs-4.15-python3-bindings-incompatibility.patch +Patch0: https://github.com/rpm-software-management/rpmlint/commit/393cde4e.patch#/0001-fix-broken-regex-for-no-manual-page-for-binary-check.patch +Patch1: https://github.com/rpm-software-management/rpmlint/commit/7d707f7f.patch#/0001-TagsCheck-handle-license-exception-in-grouping.patch +Patch2: https://github.com/rpm-software-management/rpmlint/commit/48aa148b.patch#/0001-TagsCheck-restore-space-exclusion-to-license_excepti.patch +Patch3: https://github.com/rpm-software-management/rpmlint/commit/65abdbd3.patch#/0002-TagsCheck-handle-license-exception-in-first-item-of-.patch BuildArch: noarch -BuildRequires: python3-devel rpm-python3 >= 4.4.2.2 python3-pytest sed >= 3.95 +BuildRequires: python3-devel rpm-python3 >= 4.4.2.2 python3-pytest sed >= 3.95 git Requires: python3 rpm-python3 >= 4.4.2.2 Requires: perl-interpreter cpio binutils desktop-file-utils gzip bzip2 xz %{_bindir}/groff @@ -34,34 +30,33 @@ Summary: Help document for the rpmlint package Help document for the rpmlint package. %prep -%autosetup -n %{name}-%{name}-%{version} -p1 +%autosetup -p1 -Sgit -sed -i -e /MenuCheck/d Config.py -cp -p config config.example -install -pm 644 %{SOURCE2} config +sed -i 's/python-magic/file-magic/g' setup.py + +sed -i -e 's/ --cov=rpmlint//' -e 's/ --flake8//' setup.cfg + +sed -i '/^@pytest.mark.no_cover/d' test/test_lint.py %build -make COMPILE_PYC=1 PYTHON=%{__python3} +%py3_build %install -touch rpmlint.pyc rpmlint.pyo -%make_install ETCDIR=%{_sysconfdir} MANDIR=%{_mandir} \ - LIBDIR=%{_datadir}/rpmlint BINDIR=%{_bindir} PYTHON=%{__python3} - -install -pm 644 %{SOURCE1} %{buildroot}%{_datadir}/rpmlint/config +%py3_install %files -%doc README.md config.example COPYING -%config(noreplace) %{_sysconfdir}/rpmlint/ +%doc README.md COPYING %{_bindir}/{rpmdiff,rpmlint} -%{_datadir}/rpmlint/ -%exclude %{_sysconfdir}/bash_completion.d/ +%{python3_sitelib}/rpmlint* %files help -%{_mandir}/man1/* + %changelog +* Sun Jun 25 2023 liyanan - 2.4.0-1 +- Update to 2.4.0 + * Wed Nov 4 2020 Guoshuai Sun - 1.10-19 - Ugly workaroud for RPM 4.14 vs 4.15 python3 bindings incompatibility