diff options
author | Patrik Nordvall <patrik.nordvall95@gmail.com> | 2025-03-14 12:25:59 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2025-03-18 11:03:17 +0000 |
commit | 8180865c22000adc5114a062dbe67f4b02ea06d5 (patch) | |
tree | 14dfbdc98143a8107efc929b31521f2719cac46f /bitbake/lib/bb/fetch2/git.py | |
parent | 85c2eb6d423be503fc3257340da890a36293d8e8 (diff) | |
download | poky-8180865c22000adc5114a062dbe67f4b02ea06d5.tar.gz |
bitbake: fetch2/git: Restore escape quoting for the git url when used
This fixes a bug where escapes in the url path would not be properly
restored for the git commands in the git fetcher. For example, a
space which is encoded as '%20' was not properly encoded before the
clone command.
e.g.
SRC_URI="git://git.openembedded.org/bitbake%20example/bitbake;protocol=https"
resulted in
git clone 'https://git.openembedded.org/bitbake example/bitbake'
instead of
git clone 'https://git.openembedded.org/bitbake%20example/bitbake'
(Bitbake rev: be48024253b93215bb110cd1d05925e789ec9680)
Signed-off-by: Patrik Nordvall <patrik.nordvall95@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 9a15abaa79..a73fb79ac8 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -81,6 +81,7 @@ import shlex | |||
81 | import shutil | 81 | import shutil |
82 | import subprocess | 82 | import subprocess |
83 | import tempfile | 83 | import tempfile |
84 | import urllib | ||
84 | import bb | 85 | import bb |
85 | import bb.progress | 86 | import bb.progress |
86 | from contextlib import contextmanager | 87 | from contextlib import contextmanager |
@@ -888,7 +889,7 @@ class Git(FetchMethod): | |||
888 | username = ud.user + '@' | 889 | username = ud.user + '@' |
889 | else: | 890 | else: |
890 | username = "" | 891 | username = "" |
891 | return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path) | 892 | return "%s://%s%s%s" % (ud.proto, username, ud.host, urllib.parse.quote(ud.path)) |
892 | 893 | ||
893 | def _revision_key(self, ud, d, name): | 894 | def _revision_key(self, ud, d, name): |
894 | """ | 895 | """ |