From: Mike Gilbert <floppym@gentoo.org>
To: Zac Medico <zmedico@gentoo.org>
Cc: gentoo-portage-dev@lists.gentoo.org
Subject: Re: [gentoo-portage-dev] [PATCH] Escape percent-signs in filename when fetching from mirrors
Date: Sun, 31 May 2020 17:33:22 -0400 [thread overview]
Message-ID: <CAJ0EP40zAFGzZz_9UD+htuwV3UFy7_KLS35M4S5MN6UXvM_UfA@mail.gmail.com> (raw)
In-Reply-To: <c80188dc-f9b4-9c20-32f7-6912cdd7efd4@gentoo.org>
On Sun, May 31, 2020 at 4:20 PM Zac Medico <zmedico@gentoo.org> wrote:
>
> On 5/30/20 8:26 PM, Mike Gilbert wrote:
> > Bug: https://bugs.gentoo.org/719810
> > Signed-off-by: Mike Gilbert <floppym@gentoo.org>
> > ---
> > lib/portage/package/ebuild/fetch.py | 9 +++++++--
> > 1 file changed, 7 insertions(+), 2 deletions(-)
> >
> > diff --git a/lib/portage/package/ebuild/fetch.py b/lib/portage/package/ebuild/fetch.py
> > index 28e7caf53..47c3ad28f 100644
> > --- a/lib/portage/package/ebuild/fetch.py
> > +++ b/lib/portage/package/ebuild/fetch.py
> > @@ -26,6 +26,11 @@ try:
> > except ImportError:
> > from urlparse import urlparse
> >
> > +try:
> > + from urllib.parse import quote as urlquote
> > +except ImportError:
> > + from urllib import quote as urlquote
> > +
> > import portage
> > portage.proxy.lazyimport.lazyimport(globals(),
> > 'portage.package.ebuild.config:check_config_instance,config',
> > @@ -351,7 +356,7 @@ _size_suffix_map = {
> >
> > class FlatLayout(object):
> > def get_path(self, filename):
> > - return filename
> > + return urlquote(filename)
> >
> > def get_filenames(self, distdir):
> > for dirpath, dirnames, filenames in os.walk(distdir,
> > @@ -382,7 +387,7 @@ class FilenameHashLayout(object):
> > c = c // 4
> > ret += fnhash[:c] + '/'
> > fnhash = fnhash[c:]
> > - return ret + filename
> > + return ret + urlquote(filename)
> >
> > def get_filenames(self, distdir):
> > pattern = ''
> >
>
> Please go ahead an merge, since SRC_URI arrows allow use to neglect
> unquoting as discussed in
> https://archives.gentoo.org/gentoo-portage-dev/message/176d5e6f38b346be760d05f9c6e72e02.
I ended up reverting this; I did not realize emirrordist shared the
same code. A new patch is on its way.
prev parent reply other threads:[~2020-05-31 21:33 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-31 3:26 [gentoo-portage-dev] [PATCH] Escape percent-signs in filename when fetching from mirrors Mike Gilbert
2020-05-31 6:41 ` Zac Medico
2020-05-31 15:37 ` Ulrich Mueller
2020-05-31 20:20 ` Zac Medico
2020-05-31 21:33 ` Mike Gilbert [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJ0EP40zAFGzZz_9UD+htuwV3UFy7_KLS35M4S5MN6UXvM_UfA@mail.gmail.com \
--to=floppym@gentoo.org \
--cc=gentoo-portage-dev@lists.gentoo.org \
--cc=zmedico@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox