[yocto] [PATCH] Fix gitsm.py bug that prevents fetching submodules within submodules.

Glenn Schmottlach gschmottlach at gmail.com
Sat Dec 20 07:22:36 PST 2014


Previous versions of the gitsm.py fetcher did not anticipate
submodules themselves having additional submodules. This fix
adds a recursive option so all nested submodules are fetched as
well.
---
 bitbake/lib/bb/fetch2/gitsm.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index c125cff..f89839d 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -109,8 +109,7 @@ class GitSM(Git):
         runfetchcmd("sed " + gitdir + "/config -i -e
's/bare.*=.*true/bare = false/'", d)
         os.chdir(tmpclonedir)
         runfetchcmd(ud.basecmd + " reset --hard", d)
-        runfetchcmd(ud.basecmd + " submodule init", d)
-        runfetchcmd(ud.basecmd + " submodule update", d)
+        runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)
         self._set_relative_paths(tmpclonedir)
         runfetchcmd("sed " + gitdir + "/config -i -e
's/bare.*=.*false/bare = true/'", d)
         os.rename(gitdir, ud.clonedir,)
@@ -131,6 +130,5 @@ class GitSM(Git):
         submodules = self.uses_submodules(ud, d)
         if submodules:
             runfetchcmd("cp -r " + ud.clonedir + "/modules " +
ud.destdir + "/.git/", d)
-            runfetchcmd(ud.basecmd + " submodule init", d)
-            runfetchcmd(ud.basecmd + " submodule update", d)
+            runfetchcmd(ud.basecmd + " submodule update --init --recursive", d)

-- 
1.9.1



More information about the yocto mailing list