<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 4 Aug 2019, 11:45 a.m. Khem Raj, <<a href="mailto:raj.khem@gmail.com">raj.khem@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 8/3/19 2:34 PM, Ankur Tyagi wrote:<br>
> Hi Richard,<br>
> <br>
> Any input on how it should be handled? I have identified the area like <br>
> you asked and some ways to fix it as well<br>
> <br>
> Thanks<br>
> Ankur<br>
> <br>
> On Sun, 28 Jul 2019, 9:15 p.m. Ankur Tyagi, <<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a> <br>
> <mailto:<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>>> wrote:<br>
> <br>
> How about something like this:<br>
> <br>
> diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py<br>
> index f6b5529b..fa1f9e27 100644<br>
> --- a/lib/bb/fetch2/__init__.py<br>
> +++ b/lib/bb/fetch2/__init__.py<br>
> @@ -380,6 +380,9 @@ def decodeurl(url):<br>
> user = ''<br>
> pswd = ''<br>
> <br>
> + if type not in ['git']:<br>
> + path = urllib.parse.unquote(path)<br>
> +<br>
> p = collections.OrderedDict()<br>
> if parm:<br>
> for s in parm.split(';'):<br>
> @@ -389,7 +392,7 @@ def decodeurl(url):<br>
> s1, s2 = s.split('=')<br>
> p[s1] = s2<br>
> <br>
> - return type, host, urllib.parse.unquote(path), user, pswd, p<br>
> + return type, host, path, user, pswd, p<br>
<br>
It would be good to add some self test for this case as well and patch <br>
needs to be formatted as per <br>
<a href="https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines" rel="noreferrer noreferrer" target="_blank">https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines</a><br>
<br>I wanted to get nod on the fix so that I can send v3 of patch. I like your idea for self test , any reference on how to do it would be great. Thanks<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"></blockquote></div></div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
> <br>
> def encodeurl(decoded):<br>
> """Encodes a URL from tokens (scheme, network location, path,<br>
> <br>
> regards<br>
> Ankur<br>
> <br>
> On Fri, Jul 26, 2019 at 3:13 PM Ankur Tyagi <<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a><br>
> <mailto:<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>>> wrote:<br>
> ><br>
> > Hi,<br>
> ><br>
> > Previous idea is stupid, please discard that.<br>
> > Just checked quote/unquote were added as part of commit<br>
> > b1dbc24ebcc4e5100c32568c2c41fd982fb4bcce<br>
> ><br>
> > So explaining the situation again --> when fecthing from repo url<br>
> > <a href="https://tfs.local/repos/foo%bar" rel="noreferrer noreferrer" target="_blank">https://tfs.local/repos/foo%bar</a><br>
> ><br>
> > During FetchData initialization, decodeurl(d.expand(url)) returns<br>
> path<br>
> > with %20 stripped<br>
> ><br>
> > [log][__init__][decodeurl] Path returned /repos/foo bar<br>
> ><br>
> > And when git method urldata_init() is called, it sets gitsrcname with<br>
> > space instead of %20<br>
> ><br>
> > [log][git][urldata_init] gitsrcname is tfs.local.repos.foo bar<br>
> ><br>
> > And when git method _get_repo_url is called, it always returns Path<br>
> > with space instead of %20<br>
> ><br>
> > [log][git][_get_repo_url] Path returned /repos/foo bar<br>
> ><br>
> > So I am bit confused now on how to handle it properly as unquote is<br>
> > removing %20 and it cannot be added back in later stage.<br>
> ><br>
> > Regards<br>
> > Ankur<br>
> ><br>
> ><br>
> > On Thu, Jul 25, 2019 at 7:23 PM Ankur Tyagi<br>
> <<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a> <mailto:<a href="mailto:ankur.tyagi85@gmail.com" target="_blank" rel="noreferrer">ankur.tyagi85@gmail.com</a>>> wrote:<br>
> > ><br>
> > > Hi,<br>
> > ><br>
> > > Sorry for the late reply but I have figured out where %20 is<br>
> being stripped out.<br>
> > ><br>
> > > File lib/bb/fetch2/__init__.py, method decodeurl(url) is returning<br>
> > > path as urllib.parse.unquote(path) which strips out %20<br>
> > > So if I return path as it is, then %20 is preserved and works<br>
> as expected.<br>
> > ><br>
> > > diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py<br>
> > > index f6b5529b..97fd59e1 100644<br>
> > > --- a/lib/bb/fetch2/__init__.py<br>
> > > +++ b/lib/bb/fetch2/__init__.py<br>
> > > @@ -389,7 +389,7 @@ def decodeurl(url):<br>
> > > s1, s2 = s.split('=')<br>
> > > p[s1] = s2<br>
> > ><br>
> > > - return type, host, urllib.parse.unquote(path), user, pswd, p<br>
> > > + return type, host, path, user, pswd, p<br>
> > ><br>
> > ><br>
> > > Is above change acceptable?<br>
> > ><br>
> > > Regards<br>
> > > Ankur<br>
> > ><br>
> > > On Wed, Jul 10, 2019 at 4:33 AM Richard Purdie<br>
> > > <<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank" rel="noreferrer">richard.purdie@linuxfoundation.org</a><br>
> <mailto:<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank" rel="noreferrer">richard.purdie@linuxfoundation.org</a>>> wrote:<br>
> > > ><br>
> > > > On Wed, 2019-07-10 at 21:26 +1200, Ankur Tyagi wrote:<br>
> > > > > Hi,<br>
> > > > ><br>
> > > > > Is there something else that needs to be done in this patch? Or<br>
> > > > > perhaps there is a better to handle this?<br>
> > > > > I am willing to learn and try it out if original patch is<br>
> not good.<br>
> > > ><br>
> > > > I think Mark is right, we need to figure out where the %20<br>
> characters<br>
> > > > are being stripped out and preserve them rather than<br>
> injecting them<br>
> > > > back in again.<br>
> > > ><br>
> > > > The question is therefore where they're being stripped out in<br>
> the code?<br>
> > > ><br>
> > > > Cheers,<br>
> > > ><br>
> > > > Richard<br>
> > > ><br>
> <br>
> <br>
<br>
</blockquote></div></div></div>