Skip to content

Commit

Permalink
Merge pull request rpm-software-management#943 from marxin/fix-no-man…
Browse files Browse the repository at this point in the history
…ual-page-for-binary

fix broken regex for no-manual-page-for-binary check
  • Loading branch information
marxin authored Oct 8, 2022
2 parents 95f3da0 + 393cde4 commit 09017d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rpmlint/checks/FilesCheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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<category>[^/]+)/(?P<filename>.+)')
man_base_regex = re.compile(r'^/usr(?:/share)?/man(?:/overrides)?/man(?P<category>[^/]+)/(?P<filename>((?P<binary>[^.]+)\..+))')

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)
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions test/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down

0 comments on commit 09017d3

Please sign in to comment.