diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2019-01-23 10:28:17 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-24 17:45:49 +0000 |
commit | 9238a725897e8ec18079c46f80edb9f2248133fc (patch) | |
tree | 9559c0e8f2bea451f331be215c54015bb39d222b /bitbake/lib/bb/fetch2 | |
parent | b51ccdbda8949d37254198417227ccb583328ebd (diff) | |
download | poky-9238a725897e8ec18079c46f80edb9f2248133fc.tar.gz |
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 <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 11 |
1 files changed, 6 insertions, 5 deletions
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): | |||
98 | uris[m] = md['url'] | 98 | uris[m] = md['url'] |
99 | subrevision[m] = module_hash.split()[2] | 99 | subrevision[m] = module_hash.split()[2] |
100 | 100 | ||
101 | # Convert relative to absolute uri based on parent uri | ||
102 | if uris[m].startswith('..'): | ||
103 | newud = copy.copy(ud) | ||
104 | newud.path = os.path.realpath(os.path.join(newud.path, uris[m])) | ||
105 | uris[m] = Git._get_repo_url(self, newud) | ||
106 | |||
101 | for module in submodules: | 107 | for module in submodules: |
102 | # Translate the module url into a SRC_URI | 108 | # Translate the module url into a SRC_URI |
103 | 109 | ||
@@ -120,11 +126,6 @@ class GitSM(Git): | |||
120 | # This has to be a file reference | 126 | # This has to be a file reference |
121 | proto = "file" | 127 | proto = "file" |
122 | url = "gitsm://" + uris[module] | 128 | url = "gitsm://" + uris[module] |
123 | if uris[module].startswith('..'): | ||
124 | # Local on disk relative reference | ||
125 | newud = copy.copy(ud) | ||
126 | newud.path = os.path.realpath(os.path.join(newud.path, md['url'])) | ||
127 | url = "gitsm://" + Git._get_repo_url(self, newud) | ||
128 | 129 | ||
129 | url += ';protocol=%s' % proto | 130 | url += ';protocol=%s' % proto |
130 | url += ";name=%s" % module | 131 | url += ";name=%s" % module |