[oe-commits] [bitbake] 11/11: gitsm: Allow relative URIs when fetching

git at git.openembedded.org git at git.openembedded.org
Thu Oct 4 13:29:54 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository bitbake.

commit e01bdedc357d0fc5d0f9fbeea38c272e85dbcef6
Author: Mark Hatle <mark.hatle at windriver.com>
AuthorDate: Tue Oct 2 17:08:03 2018 -0400

    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 at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/fetch2/gitsm.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index 4d3805a..0a982da 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)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list