Make it possible to ignore submodules.
authorCarl Hetherington <cth@carlh.net>
Thu, 5 Dec 2019 08:09:57 +0000 (09:09 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 5 Dec 2019 08:09:57 +0000 (09:09 +0100)
cdist

diff --git a/cdist b/cdist
index 5ad37a081d3fd03799db62070e4a2277f43b523f..8a1b3c42d676fc767f6ed74ed844263cff0330e7 100755 (executable)
--- a/cdist
+++ b/cdist
@@ -889,14 +889,17 @@ class Tree(object):
 
         command('git checkout %s %s %s' % (flags, spec, redirect))
         self.git_commit = command_and_read('git rev-parse --short=7 HEAD')[0].strip()
-        command('git submodule init --quiet')
-        command('git submodule update --quiet')
 
         proj = '%s/src/%s' % (target.directory, self.name)
 
         self.cscript = {}
         exec(open('%s/cscript' % proj).read(), self.cscript)
 
+        # cscript can include submodules = False to stop submodules being fetched
+        if not 'submodules' in self.cscript or self.cscript['submodules'] == True:
+            command('git submodule init --quiet')
+            command('git submodule update --quiet')
+
         if os.path.exists('%s/wscript' % proj):
             v = read_wscript_variable(proj, "VERSION");
             if v is not None: