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 14:33:53 +0100 |
commit | fd9893c338df7828b2c01f1d548aa86dfcf7c50a (patch) | |
tree | f8c1bceba03b187ae416e787e521fcb92d05b9f0 /lib | |
parent | 377ed943357b6d47d41d84edbf971741f44affa9 (diff) | |
download | bitbake-fd9893c338df7828b2c01f1d548aa86dfcf7c50a.tar.gz |
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.
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bb/fetch2/gitsm.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py index 4d3805a11..0a982da9c 100644 --- a/lib/bb/fetch2/gitsm.py +++ b/lib/bb/fetch2/gitsm.py @@ -31,6 +31,7 @@ NOTE: Switching a SRC_URI from "git://" to "gitsm://" requires a clean of your r import os import bb +import copy from bb.fetch2.git import Git from bb.fetch2 import runfetchcmd from bb.fetch2 import logger @@ -77,6 +78,10 @@ class GitSM(Git): submodules.append(m) paths[m] = md['path'] uris[m] = md['url'] + if uris[m].startswith('..'): + newud = copy.copy(ud) + newud.path = os.path.realpath(os.path.join(newud.path, md['url'])) + uris[m] = Git._get_repo_url(self, newud) for module in submodules: module_hash = runfetchcmd("%s ls-tree -z -d %s %s" % (ud.basecmd, ud.revisions[name], paths[module]), d, quiet=True, workdir=ud.clonedir) |