diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-27 13:24:26 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-02-28 14:24:39 +0100 |
commit | 26b4267a3b00ebedb560169d09f974cd87a6a370 (patch) | |
tree | ba77ff92b9cafe8710182d82b0ce527b72c32dfb /tools/scripts/git_submodule.py | |
parent | 42af15c421a520499bc872e2d55053dcffb2a07b (diff) | |
download | qtwebengine-26b4267a3b00ebedb560169d09f974cd87a6a370.tar.gz |
Handle recursive DEPS
Needed to include angle third party dependencies
Change-Id: I8b4fada4cac0f90f52d541953ddbdf530b6cdb37
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Diffstat (limited to 'tools/scripts/git_submodule.py')
-rw-r--r-- | tools/scripts/git_submodule.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py index 684a8af67..28b92d942 100644 --- a/tools/scripts/git_submodule.py +++ b/tools/scripts/git_submodule.py @@ -61,6 +61,9 @@ class DEPSParser: #result.update(self.custom_vars or {}) return result + def get_recursedeps(self): + return self.local_scope["recursedeps"] + def createSubmodulesFromScope(self, scope, os): submodules = [] for dep in scope: @@ -225,6 +228,9 @@ class Submodule: # The submodule operations should be done relative to the current submodule's # supermodule. if self.topmost_supermodule_path_prefix: + if not os.path.isdir(self.path): + print '-- skipping ' + self.path + ' as dir has been stripped. --' + return os.chdir(self.topmost_supermodule_path_prefix) if os.path.isdir(self.path): @@ -309,22 +315,22 @@ class Submodule: os.chdir(oldCwd) return flattened_submodules - def readSubmodules(self): + def readSubmodules(self, use_deps=False): submodules = [] - if self.ref: + if use_deps: submodules = resolver.readSubmodules() print 'DEPS file provides the following submodules:' for submodule in submodules: print '{:<80}'.format(submodule.pathRelativeToTopMostSupermodule()) + '{:<120}'.format(submodule.url) + submodule.ref - else: # Try .gitmodules since no ref has been specified + else: # Try .gitmodules instead gitmodules_file_name = '.gitmodules' submodules = self.readSubmodulesFromGitModules(self, gitmodules_file_name, self.path) return submodules def initSubmodules(self): + submodules = self.readSubmodules() oldCwd = os.getcwd() os.chdir(self.path) - submodules = self.readSubmodules() for submodule in submodules: submodule.initialize() subprocessCall(['git', 'commit', '-a', '--amend', '--no-edit']) |