Skip to content

Commit 8572940

Browse files
committed
MissingRemoteId: also check EGIT_REPO_URI
Signed-off-by: Alfred Wingate <parona@protonmail.com>
1 parent 3ffbd0e commit 8572940

File tree

5 files changed

+60
-1
lines changed

5 files changed

+60
-1
lines changed

src/pkgcheck/checks/metadata_xml.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,14 @@ def feed(self, pkgset):
702702
urls = set(filter(self.__filter_url, all_urls))
703703
urls = sorted(urls.union(pkg.homepage), key=len)
704704

705+
if "git-r3" in pkg.inherited and hasattr(pkg, "environment"):
706+
egit_repo_uri = re.compile(r"^declare -- EGIT_REPO_URI=\"(.*)\"$")
707+
for env_line in pkg.environment.data.splitlines():
708+
result = re.search(egit_repo_uri, env_line)
709+
if result:
710+
urls.append(result.group(1).removesuffix(".git"))
711+
break
712+
705713
for remote_type, regex in self.remotes_map:
706714
if remote_type in remotes:
707715
continue
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "gitlab", "value": "pkgcore/pkgcheck/extra/MissingRemoteId", "uri": "https://gitlab.com/pkgcore/pkgcheck/extra/MissingRemoteId/-/archive/1/MissingRemoteId-1.tar.bz2"}
2+
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "kde-invent", "value": "pkgcore/pkgcheck", "uri": "https://invent.kde.org/pkgcore/pkgcheck"}
23
{"__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"}
34
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "pypi", "value": "MissingRemoteId", "uri": "https://files.pythonhosted.org/packages/source/M/MissingRemoteId/MissingRemoteId-1.tar.gz"}
45
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "sourceforge", "value": "pkgcheck", "uri": "https://downloads.sourceforge.net/pkgcheck/MissingRemoteId-2.tar.gz"}
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="kde-invent">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="Check EGIT_REPO_URI"
6+
HOMEPAGE="https://pkgcore.github.io/pkgcheck/"
7+
EGIT_REPO_URI="https://invent.kde.org/pkgcore/pkgcheck.git"
8+
LICENSE="BSD"
9+
SLOT="0"
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Copyright 1999-2024 Gentoo Authors
2+
# Distributed under the terms of the GNU General Public License v2
3+
4+
# @ECLASS: git-r3.eclass
5+
# @MAINTAINER:
6+
# Michał Górny <mgorny@gentoo.org>
7+
# @SUPPORTED_EAPIS: 7 8
8+
# @BLURB: Eclass for fetching and unpacking git repositories.
9+
# @DESCRIPTION:
10+
# Third generation eclass for easing maintenance of live ebuilds using
11+
# git as remote repository.
12+
13+
case ${EAPI} in
14+
7|8) ;;
15+
*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
16+
esac
17+
18+
if [[ ! ${_GIT_R3_ECLASS} ]]; then
19+
_GIT_R3_ECLASS=1
20+
21+
# @ECLASS_VARIABLE: EGIT_REPO_URI
22+
# @REQUIRED
23+
# @DESCRIPTION:
24+
# URIs to the repository, e.g. https://foo. If multiple URIs are
25+
# provided, the eclass will consider the remaining URIs as fallbacks
26+
# to try if the first URI does not work. For supported URI syntaxes,
27+
# read the manpage for git-clone(1).
28+
#
29+
# URIs should be using https:// whenever possible. http:// and git://
30+
# URIs are completely insecure and their use (even if only as
31+
# a fallback) renders the ebuild completely vulnerable to MITM attacks.
32+
#
33+
# Can be a whitespace-separated list or an array.
34+
#
35+
# Example:
36+
# @CODE
37+
# EGIT_REPO_URI="https://a/b.git https://c/d.git"
38+
# @CODE
39+
40+
fi

0 commit comments

Comments
 (0)