[bitbake-devel] [PATCHv2] fetch2/gitsm: copy submodules from DL_DIR in unpack

Christopher Larson kergoth at gmail.com
Mon Aug 21 16:57:08 UTC 2017


From: Christopher Larson <chris_larson at mentor.com>

Revert "fetch2/gitsm: Fix when repository change submodules"

This reverts commit 12f6c0651af8bd5d6efb751690571cf2fcd3eeb0.

This commit caused the gitsm fetcher to download submodules from upstream in
do_unpack, rather than using the previously fetched submodules from DL_DIR.
Also drop the pointless checkout, as Git.unpack() already handles this
correctly.

[YOCTO #11830]

Signed-off-by: Christopher Larson <chris_larson at mentor.com>
---
 lib/bb/fetch2/gitsm.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/bb/fetch2/gitsm.py b/lib/bb/fetch2/gitsm.py
index 0aff1008..ed94c3d7 100644
--- a/lib/bb/fetch2/gitsm.py
+++ b/lib/bb/fetch2/gitsm.py
@@ -131,5 +131,6 @@ class GitSM(Git):
         Git.unpack(self, ud, destdir, d)
 
         if self.uses_submodules(ud, d, ud.destdir):
-            runfetchcmd(ud.basecmd + " checkout " + ud.revisions[ud.names[0]], d, workdir=ud.destdir)
+            if not ud.shallow or ud.localpath != ud.fullshallow:
+                runfetchcmd('cp -fpPRH "%s/modules" "%s/"' % (ud.clonedir, os.path.join(ud.destdir, '.git')), d)
             runfetchcmd(ud.basecmd + " submodule update --init --recursive", d, workdir=ud.destdir)
-- 
2.11.1




More information about the bitbake-devel mailing list