From 9238a725897e8ec18079c46f80edb9f2248133fc Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Wed, 23 Jan 2019 10:28:17 -0500 Subject: bitbake: gitsm.py: Fix relative URLs Prior code happened to work with relative URLs, when the code was recently restructured it caused all relative urls to no longer work. Restore the prior code flow for relative support and better comment why that code is there. (Bitbake rev: 14bb383af0ca98e0e04ec217e537b6a899f3658e) Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index 86198ee6cd..faffb4c77e 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -98,6 +98,12 @@ class GitSM(Git): uris[m] = md['url'] subrevision[m] = module_hash.split()[2] + # Convert relative to absolute uri based on parent uri + if 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) + for module in submodules: # Translate the module url into a SRC_URI @@ -120,11 +126,6 @@ class GitSM(Git): # This has to be a file reference proto = "file" url = "gitsm://" + uris[module] - if uris[module].startswith('..'): - # Local on disk relative reference - newud = copy.copy(ud) - newud.path = os.path.realpath(os.path.join(newud.path, md['url'])) - url = "gitsm://" + Git._get_repo_url(self, newud) url += ';protocol=%s' % proto url += ";name=%s" % module -- cgit v1.2.3-54-g00ecf