- # cscript can include submodules = False to stop submodules being fetched
- if (not 'submodules' in self.cscript or self.cscript['submodules'] == True) and os.path.exists('.gitmodules'):
- command('git submodule --quiet init')
- paths = command_and_read('git config --file .gitmodules --get-regexp path')
- urls = command_and_read('git config --file .gitmodules --get-regexp url')
- for path, url in zip(paths, urls):
- ref = ''
- if config.has('git_reference'):
- url = url.split(' ')[1]
- ref_path = os.path.join(config.get('git_reference'), os.path.basename(url))
- if os.path.exists(ref_path):
- ref = '--reference %s' % ref_path
- path = path.split(' ')[1]
- command('git submodule --quiet update %s %s' % (ref, path))
+ if not built:
+ # cscript can include submodules = False to stop submodules being fetched
+ if (not 'submodules' in self.cscript or self.cscript['submodules'] == True) and os.path.exists('.gitmodules'):
+ command('git submodule --quiet init')
+ paths = command_and_read('git config --file .gitmodules --get-regexp path')
+ urls = command_and_read('git config --file .gitmodules --get-regexp url')
+ for path, url in zip(paths, urls):
+ ref = ''
+ if config.has('git_reference'):
+ url = url.split(' ')[1]
+ ref_path = os.path.join(config.get('git_reference'), os.path.basename(url))
+ if os.path.exists(ref_path):
+ ref = '--reference %s' % ref_path
+ path = path.split(' ')[1]
+ command('git submodule --quiet update %s %s' % (ref, path))