Skip to content

Commit e4431da

Browse files
committed
MissingRemoteId: also check EGIT_REPO_URI
Signed-off-by: Alfred Wingate <[email protected]>
1 parent 4776408 commit e4431da

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

src/pkgcheck/checks/metadata_xml.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -690,7 +690,17 @@ def feed(self, pkgset):
690690
chain.from_iterable(f.uri for f in fetchables if isinstance(f, fetchable))
691691
)
692692
urls = {url for url in all_urls if not url.endswith((".patch", ".diff"))}
693-
urls = sorted(urls.union(pkg.homepage), key=len)
693+
urls = urls.union(pkg.homepage)
694+
695+
if "git-r3" in pkg.inherited and hasattr(pkg, "environment"):
696+
egit_repo_uri = re.compile(r"EGIT_REPO_URI=\"(.*)\"")
697+
for env_line in pkg.environment.data.splitlines():
698+
result = re.search(egit_repo_uri, env_line)
699+
if result:
700+
urls.add(result.group(1).removesuffix(".git"))
701+
break
702+
703+
urls = sorted(urls, key=len)
694704

695705
for remote_type, regex in self.remotes_map:
696706
if remote_type in remotes:
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
--- eapis-testing/MissingRemoteIdCheck/MissingRemoteId/metadata.xml
22
+++ fixed/MissingRemoteIdCheck/MissingRemoteId/metadata.xml
3-
@@ -3,6 +3,10 @@
3+
@@ -3,6 +3,11 @@
44
<pkgmetadata>
55
<upstream>
66
<remote-id type="bitbucket">pkgcore/pkgcheck</remote-id>
77
+ <remote-id type="gitlab">pkgcore/pkgcheck/extra/MissingRemoteId</remote-id>
88
+ <remote-id type="heptapod">pkgcore/pkgcheck</remote-id>
99
+ <remote-id type="pypi">MissingRemoteId</remote-id>
1010
+ <remote-id type="sourceforge">pkgcheck</remote-id>
11+
+ <remote-id type="gitlab">pkgcore/pkgcheck</remote-id>
1112
</upstream>
1213
<use>
1314
<flag name="test">enable tests</flag>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
EAPI=7
2+
3+
inherit git-r3
4+
5+
DESCRIPTION="Don't suggest where already value exists"
6+
HOMEPAGE="https://pkgcore.github.io/pkgcheck/"
7+
EGIT_REPO_URI="https://gitlab.com/pkgcore/pkgcheck.git"
8+
LICENSE="BSD"
9+
SLOT="0"

0 commit comments

Comments
 (0)