]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
bitbake: gitsm: Allow relative URIs when fetching
authorMark Hatle <mark.hatle@windriver.com>
Tue, 2 Oct 2018 21:08:03 +0000 (17:08 -0400)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 4 Oct 2018 22:00:24 +0000 (23:00 +0100)
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>
bitbake/lib/bb/fetch2/gitsm.py

index 4d3805a11c18f7622a079e170b01d14871b1be7f..0a982da9c654a318a7a64eda53a5f2796df92eae 100644 (file)
@@ -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)