Gentoo Archives: gentoo-portage-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] repoman: add HOMEPAGE.missingurischeme check
Date: Sat, 07 Jan 2017 13:33:05
Message-Id: 1717b827-ce1a-53d9-b72d-3326abfef13b@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] repoman: add HOMEPAGE.missingurischeme check by Wim Muskee
1 On 01/07/2017 06:08 AM, Wim Muskee wrote:
2 >
3 > URISCHEME_RE = re.compile(r'^[a-z\-]+://')
4 >
5 > ...
6 >
7 > URISCHEME_RE.match(ebuild.metadata.get("HOMEPAGE")) is None:
8 >
9
10 The PMS allows some weird stuff in HOMEPAGE:
11
12 https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-760008
13
14 Specifically,
15
16 In addition, SRC_URI, HOMEPAGE, RESTRICT, PROPERTIES, LICENSE and
17 REQUIRED_USE use dependency-style specifications to specify their
18 values.
19
20 That means that something like,
21
22 HOMEPAGE="branding? ( https://www.mozilla.org/ )
23 !branding? ( https://www.gentoo.org/ )"
24
25 would be valid. It's a little crazy, but there it is.
26
27 If you can figure out a way to parse a dependency spec (this has to
28 exist somewhere in repoman/portage), then you can run your check against
29 the URLs at the leaf nodes. At that point, it should be relatively easy
30 to update the regex to match the RFC =)
31
32 https://tools.ietf.org/html/rfc3986#section-3.1

Replies