diff options
author | Mike Crowe <mac@mcrowe.com> | 2023-02-24 16:50:54 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-25 14:03:51 +0000 |
commit | 47b271e6c8d96960ebe70f80e58f30cc4cbf42e1 (patch) | |
tree | 7eae069ae7821192f7e349410aba55ebfb65a916 | |
parent | f9165a798a307a6f0fee120d5c3de660d3a44ae8 (diff) | |
download | bitbake-47b271e6c8d96960ebe70f80e58f30cc4cbf42e1.tar.gz |
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.
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Co-authored-by: Dave Craig
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/fetch2/gitsm.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py index fee40cdcb..f8e239bc5 100644 --- a/lib/bb/fetch2/gitsm.py +++ b/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: |