From f2da187f9456852d9e57f2c10c0ac84bba800a8f Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Tue, 12 Mar 2019 18:46:26 -0400 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: acca06d060e49b2441562b4dc94416af9ab8187e) Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie (cherry picked from commit 8c8ecec2a722bc2885e2648d41ac8df07bdf660d) Signed-off-by: Scott Murray Signed-off-by: Armin Kuster 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/gitsm.py') 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