From c1f1422a95e1939e00d8cda9523b1a99d051cd14 Mon Sep 17 00:00:00 2001 From: Mike Crowe Date: Fri, 24 Feb 2023 16:50:54 +0000 Subject: bitbake: gitsm: Fix path construction for relative submodule URI The submodule repository URI contains a path to something not necessarily on the local filesystem. This means that we can't use realpath to normalise it without risking getting bad results if the path happens to match something on the local filesystem. This situation can cause very confusing errors if that matching local path happens to be a symlink to somewhere else. Using normpath rather than realpath means that the path simplification follows simple rules on the string rather than looking at the local filesystem and avoids problems. (Bitbake rev: 47b271e6c8d96960ebe70f80e58f30cc4cbf42e1) Signed-off-by: Mike Crowe Co-authored-by: Dave Craig Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index fee40cdcb4..f8e239bc5d 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -90,7 +90,7 @@ class GitSM(Git): # Convert relative to absolute uri based on parent uri if uris[m].startswith('..') or uris[m].startswith('./'): newud = copy.copy(ud) - newud.path = os.path.realpath(os.path.join(newud.path, uris[m])) + newud.path = os.path.normpath(os.path.join(newud.path, uris[m])) uris[m] = Git._get_repo_url(self, newud) for module in submodules: -- cgit v1.2.3-54-g00ecf