Gentoo Archives: gentoo-portage-dev

From: Ulrich Mueller <ulm@g.o>
To: Zac Medico <zmedico@g.o>
Cc: gentoo-portage-dev@l.g.o, Mike Gilbert <floppym@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] Improve handling of percent-signs in SRC_URI
Date: Sun, 31 May 2020 20:24:44
Message-Id: uk10ronsq@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] Improve handling of percent-signs in SRC_URI by Zac Medico
1 >>>>> On Sun, 31 May 2020, Zac Medico wrote:
2
3 > We've also got these other basename calls in fetch.py:
4
5 >> diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
6 >> index 28e7caf53..56b375d58 100644
7 >> --- a/lib/portage/package/ebuild/fetch.py
8 >> +++ b/lib/portage/package/ebuild/fetch.py
9 >> @@ -730,9 +730,9 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0,
10 >> else:
11 >> for myuri in myuris:
12 >> if urlparse(myuri).scheme:
13 >> - file_uri_tuples.append((os.path.basename(myuri), myuri))
14 >> + file_uri_tuples.append((urlunquote(os.path.basename(myuri)), myuri))
15 >> else:
16 >> - file_uri_tuples.append((os.path.basename(myuri), None))
17 >> + file_uri_tuples.append((urlunquote(os.path.basename(myuri)), None))
18
19 > The case with no scheme is not a URI, so we need to decide whether
20 > or not to unquote, and we should make _parse_uri_map behavior
21 > consistent for this case.
22
23 I think that this follows from PMS, section 8.2 [1]:
24
25 | The following elements are recognised in at least one class of
26 | specification. All elements must be surrounded on both sides by
27 | whitespace, except at the start and end of the string.
28 |
29 | [...]
30 | - A URI, in the form proto://host/path. Permitted in SRC_URI and
31 | HOMEPAGE. In EAPIs listed in table 8.4 as supporting SRC_URI arrows,
32 | may optionally be followed by whitespace, then ->, then whitespace,
33 | then a simple filename when in SRC_URI. For SRC_URI behaviour, see
34 | section 8.2.10.
35 | - A flat filename. Permitted in SRC_URI.
36
37 So if it isn't an URI then it is a "flat filename" which IMHO is to be
38 interpreted literally without any unquoting.
39
40 Ulrich
41
42 [1] https://projects.gentoo.org/pms/7/pms.html#x1-690008.2

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies