aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/gitsm.py
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2019-03-12 18:46:25 -0400
committerArmin Kuster <akuster@mvista.com>2019-03-13 08:05:19 -0700
commit39afa6ead1d72813b2a294f065d759bad08fb53d (patch)
treedac0e56d1fb3991c4b60af56fd7006a9b2d3c03d /lib/bb/fetch2/gitsm.py
parent8b02eb8e5d8e3a09e19ed96a4ccdf5f755e97a74 (diff)
downloadbitbake-contrib-39afa6ead1d72813b2a294f065d759bad08fb53d.tar.gz
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. Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 14bb383af0ca98e0e04ec217e537b6a899f3658e) Signed-off-by: Scott Murray <scott.murray@konsulko.com> Signed-off-by: Armin Kuster <akuster@mvista.com>
Diffstat (limited to 'lib/bb/fetch2/gitsm.py')
-rw-r--r--lib/bb/fetch2/gitsm.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index 86198ee6c..faffb4c77 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/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