1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

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 <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Mark Hatle
2019-01-23 10:28:18 -05:00
committed by Richard Purdie
parent 9238a72589
commit 1979d9162a
2 changed files with 32 additions and 3 deletions
+6 -3
View File
@@ -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)