chiark / gitweb /
Do submodules recursively, do init and update at the same time
authorDaniel Martí <mvdan@mvdan.cc>
Tue, 28 Jan 2014 22:49:36 +0000 (23:49 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Tue, 28 Jan 2014 22:49:36 +0000 (23:49 +0100)
docs/fdroid.texi
fdroidserver/common.py

index cb5d17a2a577090d05f500c4b2f6cabd752b18ff..765dd5e846cc75e2d03dd6bc15008ccdda5d7306 100644 (file)
@@ -820,8 +820,10 @@ Specifies to build from a subdirectory of the checked out source code.
 Normally this directory is changed to before building,
 
 @item submodules=yes
-Use if the project (git only) has submodules - causes git submodule
-init and update to be executed after the source is cloned.
+Use if the project (git only) has submodules - causes @code{git submodule
+update --init --recursive} to be executed after the source is cloned.
+Submodules are reset and cleaned like the main app repository itself before
+each build.
 
 @item init=xxxx
 As for 'prebuild', but runs on the source code BEFORE any other processing
index 3bca96d3c6666171e2912cb25a4167bae06385a7..6ccb30d0d2dd935d1b5716913d7859133eb4231c 100644 (file)
@@ -336,10 +336,8 @@ class vcs_git(vcs):
 
     def initsubmodules(self):
         self.checkrepo()
-        if subprocess.call(['git', 'submodule', 'init'],
-                cwd=self.local) != 0:
-            raise VCSException("Git submodule init failed")
-        if subprocess.call(['git', 'submodule', 'update'],
+        if subprocess.call(['git', 'submodule', 'update',
+            '--init', '--recursive'],
                 cwd=self.local) != 0:
             raise VCSException("Git submodule update failed")
         if subprocess.call(['git', 'submodule', 'foreach',