diff mbox series

[kirkstone,2.0,08/14] fetch2: gitsm: fix incorrect handling of git submodule relative urls

Message ID 394bcd8d4b8f596cbfeef7ab9a5b043c209c81dd.1663078873.git.steve@sakoman.com
State Accepted, archived
Commit d828cd2a16ddf4f084e61ffe44471483e132653a
Headers show
Series [kirkstone,2.0,01/14] runqueue: Fix unihash cache mismatch issues | expand

Commit Message

Steve Sakoman Sept. 13, 2022, 2:26 p.m. UTC
From: Gennaro Iorio <gen.iorio92@gmail.com>

As specified by git submodule manual relative urls can start either
with '..' or './', second case was incorrectly managed leading to an
interpretation of urls starting with './' as absoulte urls.

Signed-off-by: Gennaro Iorio <gennaro.iorio@schindler.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 4a0bd3bcd1f7fc25364df8bbf185ff64881c015b)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
---
 lib/bb/fetch2/gitsm.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index c5c23d52..c1950e48 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -88,7 +88,7 @@  class GitSM(Git):
                 subrevision[m] = module_hash.split()[2]
 
                 # Convert relative to absolute uri based on parent uri
-                if uris[m].startswith('..'):
+                if  uris[m].startswith('..') or uris[m].startswith('./'):
                     newud = copy.copy(ud)
                     newud.path = os.path.realpath(os.path.join(newud.path, uris[m]))
                     uris[m] = Git._get_repo_url(self, newud)