>>>>> On Sun, 31 May 2020, Zac Medico wrote:

> In order to ensure that the filename will not have an extra level of quoting
> in the mirror path, we'll have to do something like this wherever we
> translate a uri in SRC_URI to a filename:

> diff --git a/lib/portage/dbapi/porttree.py b/lib/portage/dbapi/porttree.py
> index 08af17bcd..99d8ab720 100644
> --- a/lib/portage/dbapi/porttree.py
> +++ b/lib/portage/dbapi/porttree.py
> @@ -1547,7 +1547,7 @@ def _parse_uri_map(cpv, metadata, use=None):
>                         myuris.pop()
>                         distfile = myuris.pop()
>                 else:
> -                       distfile = os.path.basename(uri)
> +                       distfile = unquote(os.path.basename(uri))
>                         if not distfile:
>                                 raise portage.exception.InvalidDependString(
>                                         ("getFetchMap(): '%s' SRC_URI has no 
> file " + \

I think that unescaping is correct, but you'll need a subsequent sanity
check to make sure that the resulting filename doesn't contain any
characters that aren't allowed in the Manifest.

Namely, "excluding the backwards slash (\) and characters classified as
control characters or as whitespace" (GLEP 74).

Ulrich

Attachment: signature.asc
Description: PGP signature

Reply via email to