<div dir="ltr">I had a snafu when prepping the submission of this revision. Ignore it; I've submitted rev3 now: <a href="http://lists.openembedded.org/pipermail/bitbake-devel/2018-May/009325.html">http://lists.openembedded.org/pipermail/bitbake-devel/2018-May/009325.html</a>.</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 11, 2018 at 8:53 AM, Matt Hoosier <span dir="ltr"><<a href="mailto:matt.hoosier@gmail.com" target="_blank">matt.hoosier@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Although the submodules' histories have been fetched during the<br>
do_fetch() phase, the mechanics used to clone the workdir copy<br>
of the repo haven't been transferring the actual .git/modules<br>
directory from the repo fetched into downloads/ during the<br>
fetch task.<br>
<br>
Fix that, and for good measure also explicitly tell Git to avoid<br>
hitting the network during do_unpack() of the submodules.<br>
<br>
Rev2 changes:<br>
<br>
- Fixed a failure when unpacking a shallow cloned mirror repository.<br>
<br>
[YOCTO #12739]<br>
<br>
Signed-off-by: Matt Hoosier <<a href="mailto:matt.hoosier@gmail.com">matt.hoosier@gmail.com</a>><br>
---<br>
lib/bb/fetch2/gitsm.py | 12 +++++++++++-<br>
1 file changed, 11 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py<br>
index 0aff1008..1f3fc443 100644<br>
--- a/lib/bb/fetch2/gitsm.py<br>
+++ b/lib/bb/fetch2/gitsm.py<br>
@@ -132,4 +132,14 @@ class GitSM(Git):<br>
<br>
if self.uses_submodules(ud, d, ud.destdir):<br>
runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)<br>
- runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)<br>
+<br>
+ # Copy over the submodules' fetched histories too.<br>
+ if ud.bareclone:<br>
+ repo_conf = ud.destdir<br>
+ else:<br>
+ repo_conf = os.path.join(ud.destdir, '.git')<br>
+ runfetchcmd("cp -pr %s %s" % (os.path.join(ud.clonedir, 'modules'), repo_conf), d)<br>
+<br>
+ # Careful not to hit the network during unpacking; all history should already<br>
+ # be fetched.<br>
+ runfetchcmd(ud.basecmd + " submodule update --init --recursive --no-fetch", d, workdir=ud.destdir)<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.13.6<br>
<br>
</font></span></blockquote></div><br></div>