commit: 18abe5874888fe4c923545b70cc43ca96f57776a
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 28 16:40:04 2025 +0000
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 28 16:40:04 2025 +0000
URL:
https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=18abe587
MissingRemoteId: don't report for -crates or -deps
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
src/pkgcheck/checks/metadata_xml.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/pkgcheck/checks/metadata_xml.py
b/src/pkgcheck/checks/metadata_xml.py
index cfba70c8..49bd3cfb 100644
--- a/src/pkgcheck/checks/metadata_xml.py
+++ b/src/pkgcheck/checks/metadata_xml.py
@@ -675,6 +675,16 @@ class MissingRemoteIdCheck(Check):
(remote_type, re.compile(regex)) for remote_type, regex in
self.remotes_map
)
+ @staticmethod
+ def __filter_url(url: str) -> bool:
+ if url.endswith((".patch", ".diff")):
+ return False
+ if "-crates.tar" in url:
+ return False
+ if "-deps.tar" in url:
+ return False
+ return True
+
def feed(self, pkgset):
remotes = {u.type: (None, None) for u in pkgset[0].upstreams}
for pkg in sorted(pkgset, reverse=True):
@@ -686,10 +696,10 @@ class MissingRemoteIdCheck(Check):
),
(fetchable, Conditional),
)
- all_urls = set(
+ all_urls: set[str] = set(
chain.from_iterable(f.uri for f in fetchables if isinstance(f,
fetchable))
)
- urls = {url for url in all_urls if not url.endswith((".patch",
".diff"))}
+ urls = set(filter(self.__filter_url, all_urls))
urls = sorted(urls.union(pkg.homepage), key=len)
for remote_type, regex in self.remotes_map: