1 |
commit: 5e05fd7c59d0853e6472bf65d619cedafb4880b7 |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Oct 30 18:02:16 2022 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Oct 30 18:02:16 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcheck.git/commit/?id=5e05fd7c |
7 |
|
8 |
MissingRemoteIdCheck: fix bad suggestion for downloads.sourceforge.net |
9 |
|
10 |
For sourceforge, the order of regexes was bad, resulting in it catching |
11 |
`downloads.sourceforge.net` as project under `sourceforge.net` instead, |
12 |
which is very wrong. Fix the order, and update the test to check for |
13 |
this case specially. |
14 |
|
15 |
On the same note, add support for `sourceforge.io` as a site - cause |
16 |
looks like it also appears in the wild. |
17 |
|
18 |
Resolves: https://github.com/pkgcore/pkgcheck/issues/488 |
19 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
20 |
|
21 |
src/pkgcheck/checks/metadata_xml.py | 6 +++--- |
22 |
.../MissingRemoteIdCheck/MissingRemoteId/expected.json | 2 +- |
23 |
.../MissingRemoteIdCheck/MissingRemoteId/MissingRemoteId-2.ebuild | 4 ++-- |
24 |
3 files changed, 6 insertions(+), 6 deletions(-) |
25 |
|
26 |
diff --git a/src/pkgcheck/checks/metadata_xml.py b/src/pkgcheck/checks/metadata_xml.py |
27 |
index 56dd2c94..06d62cf3 100644 |
28 |
--- a/src/pkgcheck/checks/metadata_xml.py |
29 |
+++ b/src/pkgcheck/checks/metadata_xml.py |
30 |
@@ -601,9 +601,9 @@ class MissingRemoteIdCheck(Check): |
31 |
('pypi', r'https://files.pythonhosted.org/packages/source/\S/(?P<value>[^/]+)'), |
32 |
('savannah', r'https://savannah.gnu.org/projects/(?P<value>[^/]+)'), |
33 |
('savannah-nongnu', r'https://savannah.nongnu.org/projects/(?P<value>[^/]+)'), |
34 |
- ('sourceforge', r'https://(?P<value>[^/]+).sourceforge.net/'), |
35 |
- ('sourceforge', r'https://sourceforge.net/projects/(?P<value>[^/]+)'), |
36 |
- ('sourceforge', r'https://downloads.sourceforge.net/(?:project/)?(?P<value>[^/]+)'), |
37 |
+ ('sourceforge', r'https://downloads.sourceforge.(net|io)/(?:project/)?(?P<value>[^/]+)'), |
38 |
+ ('sourceforge', r'https://sourceforge.(net|io)/projects/(?P<value>[^/]+)'), |
39 |
+ ('sourceforge', r'https://(?P<value>[^/]+).sourceforge.(net|io)/'), |
40 |
('sourcehut', r'https://sr.ht/(?P<value>[^/]+/[^/]+)'), |
41 |
) |
42 |
|
43 |
|
44 |
diff --git a/testdata/data/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/expected.json b/testdata/data/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/expected.json |
45 |
index ab5ae2d4..9d74b4e9 100644 |
46 |
--- a/testdata/data/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/expected.json |
47 |
+++ b/testdata/data/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/expected.json |
48 |
@@ -1,4 +1,4 @@ |
49 |
{"__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"} |
50 |
{"__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"} |
51 |
{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "pypi", "value": "MissingRemoteId", "uri": "https://files.pythonhosted.org/packages/source/M/MissingRemoteId/MissingRemoteId-1.tar.gz"} |
52 |
-{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "sourceforge", "value": "pkgcheck", "uri": "https://pkgcheck.sourceforge.net/"} |
53 |
+{"__class__": "MissingRemoteId", "category": "MissingRemoteIdCheck", "package": "MissingRemoteId", "remote_type": "sourceforge", "value": "pkgcheck", "uri": "https://downloads.sourceforge.net/pkgcheck/MissingRemoteId-2.tar.gz"} |
54 |
|
55 |
diff --git a/testdata/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/MissingRemoteId-2.ebuild b/testdata/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/MissingRemoteId-2.ebuild |
56 |
index ed226b8e..2ee1bda2 100644 |
57 |
--- a/testdata/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/MissingRemoteId-2.ebuild |
58 |
+++ b/testdata/repos/eapis-testing/MissingRemoteIdCheck/MissingRemoteId/MissingRemoteId-2.ebuild |
59 |
@@ -1,7 +1,7 @@ |
60 |
EAPI=7 |
61 |
|
62 |
DESCRIPTION="Check homepage" |
63 |
-HOMEPAGE="https://pkgcheck.sourceforge.net/" |
64 |
-SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" |
65 |
+HOMEPAGE="https://pkgcore.github.io/pkgcheck/" |
66 |
+SRC_URI="mirror://sourceforge/pkgcheck/${P}.tar.gz" |
67 |
LICENSE="BSD" |
68 |
SLOT="0" |