From 1979d9162a335b7d4718a6697ca57bfa16237f0e Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Wed, 23 Jan 2019 10:28:18 -0500 Subject: bitbake: gitsmy.py: Fix unpack of submodules of submodules If the submodule is in a subdirectory, it needs to have that structure preserved. This means the unpack path needs to be in the 'dirname' of the final path -- since the unpack directory name is specified in the URI. Additional specific test cases were added to ensure this is working properly based on two recent error reports. (Bitbake rev: 8c8ecec2a722bc2885e2648d41ac8df07bdf660d) Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie --- bitbake/lib/bb/fetch2/gitsm.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/fetch2') diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py index faffb4c77e..f45546b49b 100644 --- a/bitbake/lib/bb/fetch2/gitsm.py +++ b/bitbake/lib/bb/fetch2/gitsm.py @@ -176,12 +176,11 @@ class GitSM(Git): try: newfetch = Fetch([url], d, cache=False) - newfetch.unpack(root=os.path.join(repo_conf, 'modules')) + newfetch.unpack(root=os.path.dirname(os.path.join(repo_conf, 'modules', modpath))) except Exception as e: logger.error('gitsm: submodule unpack failed: %s %s' % (type(e).__name__, str(e))) raise - newfetch = Fetch([url], d, cache=False) local_path = newfetch.localpath(url) # Correct the submodule references to the local download version... @@ -191,7 +190,11 @@ class GitSM(Git): runfetchcmd("%(basecmd)s config submodule.%(module)s.shallow true" % {'basecmd': ud.basecmd, 'module': module}, d, workdir=ud.destdir) # Ensure the submodule repository is NOT set to bare, since we're checking it out... - runfetchcmd("%s config core.bare false" % (ud.basecmd), d, quiet=True, workdir=os.path.join(repo_conf, 'modules', modpath)) + try: + runfetchcmd("%s config core.bare false" % (ud.basecmd), d, quiet=True, workdir=os.path.join(repo_conf, 'modules', modpath)) + except: + logger.error("Unable to set git config core.bare to false for %s" % os.path.join(repo_conf, 'modules', modpath)) + raise Git.unpack(self, ud, destdir, d) -- cgit v1.2.3-54-g00ecf