Skip to content

Commit

Permalink
MissingRemoteId: also check EGIT_REPO_URI
Browse files Browse the repository at this point in the history
Signed-off-by: Alfred Wingate <[email protected]>
  • Loading branch information
parona-source committed Dec 22, 2023
1 parent 4776408 commit da2225e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/pkgcheck/checks/metadata_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,17 @@ def feed(self, pkgset):
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 = sorted(urls.union(pkg.homepage), key=len)
urls = urls.union(pkg.homepage)

if "git-r3" in pkg.inherited and hasattr(pkg, "environment"):
egit_repo_uri = re.compile(r"EGIT_REPO_URI=\"(.*)\"")
for env_line in pkg.environment.data.splitlines():
result = re.search(egit_repo_uri, env_line)
if result:
urls.add(result.group(1).removesuffix(".git"))
break

urls = sorted(urls, key=len)

for remote_type, regex in self.remotes_map:
if remote_type in remotes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "heptapod", "value": "pkgcore/pkgcore", "uri": "https://foss.heptapod.net/pkgcore/pkgcore/-/archive/4/MissingRemoteId-4.tar.bz2"}
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "pypi", "value": "MissingRemoteId", "uri": "https://files.pythonhosted.org/packages/source/M/MissingRemoteId/MissingRemoteId-1.tar.gz"}
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "sourceforge", "value": "pkgcheck", "uri": "https://downloads.sourceforge.net/pkgcheck/MissingRemoteId-2.tar.gz"}
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "gitlab", "value": "pkgcore/pkgcheck", "uri": "https://gitlab.com/pkgcore/pkgcheck"}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
--- eapis-testing/MissingRemoteIdCheck/MissingRemoteId/metadata.xml
+++ fixed/MissingRemoteIdCheck/MissingRemoteId/metadata.xml
@@ -3,6 +3,10 @@
@@ -3,6 +3,11 @@
<pkgmetadata>
<upstream>
<remote-id type="bitbucket">pkgcore/pkgcheck</remote-id>
+ <remote-id type="gitlab">pkgcore/pkgcheck/extra/MissingRemoteId</remote-id>
+ <remote-id type="heptapod">pkgcore/pkgcheck</remote-id>
+ <remote-id type="pypi">MissingRemoteId</remote-id>
+ <remote-id type="sourceforge">pkgcheck</remote-id>
+ <remote-id type="gitlab">pkgcore/pkgcheck</remote-id>
</upstream>
<use>
<flag name="test">enable tests</flag>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
EAPI=7

inherit git-r3

DESCRIPTION="Don't suggest where already value exists"
HOMEPAGE="https://pkgcore.github.io/pkgcheck/"
EGIT_REPO_URI="https://gitlab.com/pkgcore/pkgcheck.git"
LICENSE="BSD"
SLOT="0"

0 comments on commit da2225e

Please sign in to comment.