bitbake-devel.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bitbake: git fetcher: use urllib quote ...
@ 2023-03-22  8:37 CESTONARO Thilo
  2023-03-22 10:40 ` [bitbake-devel] " Michael Opdenacker
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: CESTONARO Thilo @ 2023-03-22  8:37 UTC (permalink / raw)
  To: bitbake-devel; +Cc: CESTONARO Thilo

[-- Attachment #1: Type: text/plain, Size: 1216 bytes --]

to use the path url-compatible. This needs to happen before the shell quotation happens.

Without this commit, spaces in the clone URL will be used as " " and not as "%20" which will fail.
This commit changes the " " in the URL to "%20" when it is a http or https url.

Signed-off-by: Thilo Cestonaro <thilo.cestonaro@thalesgroup.com>
---
 lib/bb/fetch2/git.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 578edc59..dc7f848d 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -66,6 +66,7 @@ import re
 import shlex
 import subprocess
 import tempfile
+import urllib
 import bb
 import bb.progress
 from contextlib import contextmanager
@@ -697,7 +698,12 @@ class Git(FetchMethod):
             username = ud.user + '@'
         else:
             username = ""
-        return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
+
+        path = ud.path
+        if ud.proto in [ 'http', 'https' ]:
+            path = urllib.parse.quote(ud.path)
+
+        return "%s://%s%s%s" % (ud.proto, username, ud.host, path)

     def _revision_key(self, ud, d, name):
         """
--
2.37.2


[-- Attachment #2: Type: text/html, Size: 3561 bytes --]

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-05-10 13:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22  8:37 [PATCH] bitbake: git fetcher: use urllib quote CESTONARO Thilo
2023-03-22 10:40 ` [bitbake-devel] " Michael Opdenacker
2023-04-19 12:22   ` AW: " CESTONARO Thilo
2023-03-24 10:13 ` Alexandre Belloni
2023-04-20 11:43 ` Richard Purdie
2023-05-10 13:10   ` [PATCH v2] " CESTONARO Thilo
2023-05-10 13:24     ` [bitbake-devel] " Michael Opdenacker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).