diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2018-10-02 17:08:03 -0400 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-10-04 23:00:24 +0100 |
commit | 8c3db8cb9ed6c4d2d293d2faddabe6918edab7b9 (patch) | |
tree | 166d953d2b02b93d7d330ae60b7fe51de2960c30 /bitbake/lib/bb | |
parent | 41e6a3efac837c2ae812accf3371f7aad9ac21e4 (diff) | |
download | poky-8c3db8cb9ed6c4d2d293d2faddabe6918edab7b9.tar.gz |
bitbake: gitsm: Allow relative URIs when fetching
Some repositories may specify a relative submodule path. If this happens,
it is our responsibility to use the parents URL (ud) and handle any relative
processing ourselves.
(Bitbake rev: fd9893c338df7828b2c01f1d548aa86dfcf7c50a)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb')
-rw-r--r-- | bitbake/lib/bb/fetch2/gitsm.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index 4d3805a11c..0a982da9c6 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py | |||
@@ -31,6 +31,7 @@ NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your r | |||
31 | 31 | ||
32 | import os | 32 | import os |
33 | import bb | 33 | import bb |
34 | import copy | ||
34 | from bb.fetch2.git import Git | 35 | from bb.fetch2.git import Git |
35 | from bb.fetch2 import runfetchcmd | 36 | from bb.fetch2 import runfetchcmd |
36 | from bb.fetch2 import logger | 37 | from bb.fetch2 import logger |
@@ -77,6 +78,10 @@ class GitSM(Git): | |||
77 | submodules.append(m) | 78 | submodules.append(m) |
78 | paths[m] = md['path'] | 79 | paths[m] = md['path'] |
79 | uris[m] = md['url'] | 80 | uris[m] = md['url'] |
81 | if uris[m].startswith('..'): | ||
82 | newud = copy.copy(ud) | ||
83 | newud.path = os.path.realpath(os.path.join(newud.path, md['url'])) | ||
84 | uris[m] = Git._get_repo_url(self, newud) | ||
80 | 85 | ||
81 | for module in submodules: | 86 | for module in submodules: |
82 | module_hash = runfetchcmd("%s ls-tree -z -d %s %s" % (ud.basecmd, ud.revisions[name], paths[module]), d, quiet=True, workdir=ud.clonedir) | 87 | module_hash = runfetchcmd("%s ls-tree -z -d %s %s" % (ud.basecmd, ud.revisions[name], paths[module]), d, quiet=True, workdir=ud.clonedir) |