commit:     d2ff093fae54ee3507a97c6d91c86fd093e46c29
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat Oct 29 05:20:50 2022 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat Oct 29 05:20:50 2022 +0000
URL:        
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=d2ff093f

BetterCompressionCheck: fix false positive when fixed

When the issue is fixed, we get a url which looks like "${URL}.tar.bz2",
but this URL was matching for the ".tar" extension in previous regex
variant. Fix this by forcing the after ".tar" a ".bz2" doesn't appear.

Resolves: https://github.com/pkgcore/pkgcheck/issues/487
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 src/pkgcheck/checks/codingstyle.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pkgcheck/checks/codingstyle.py 
b/src/pkgcheck/checks/codingstyle.py
index 0933c492..b6ef8c34 100644
--- a/src/pkgcheck/checks/codingstyle.py
+++ b/src/pkgcheck/checks/codingstyle.py
@@ -416,7 +416,7 @@ class BetterCompressionCheck(Check):
     known_results = frozenset([BetterCompressionUri])
 
     REGEXPS = (
-        
(r'.*\b(?P<uri>(?P<prefix>https?://[^/]*?gitlab[^/]*?/.*/-/archive/.*?/\S*)\.(?:tar\.gz|tar|zip))',
+        
(r'.*\b(?P<uri>https?://[^/]*?gitlab[^/]*?/.*/-/archive/.*?/\S*\.(?:tar\.gz|tar(?!.bz2)|zip))',
          '.tar.bz2'),
     )
 

Reply via email to