Gentoo Archives: gentoo-portage-dev

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

Attachments

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

Replies