diff options
author | Michal Klocek <michal.klocek@qt.io> | 2023-02-16 10:19:16 +0100 |
---|---|---|
committer | Michal Klocek <michal.klocek@qt.io> | 2023-02-23 03:29:13 +0100 |
commit | e5f0892c4c94da31035ea25c40ad847ff01d133d (patch) | |
tree | be469d496b85172760395149d16a6cd87e791c47 /tools/scripts/git_submodule.py | |
parent | 7e4cd3a66fb3a8ef4eab64a9f067f90db2a4cb52 (diff) |
Add whitelist for version resolver
If DEPS entry has condition we only care about linux_checkout,
however we need also some files for andorid, add white list to
keep the checkouts to minimum.
Upadate black listed submodules.
Task-number: QTBUG-83459
Change-Id: Id6f744dd52880a2f43c5fc3655837612c82d2f6e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tools/scripts/git_submodule.py')
-rw-r--r-- | tools/scripts/git_submodule.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py index b2c21de27..89af8aa41 100644 --- a/tools/scripts/git_submodule.py +++ b/tools/scripts/git_submodule.py @@ -31,7 +31,7 @@ class SubmoduleDEPSParser(resolver.DEPSParser): #result.update(self.custom_vars or {}) return result - def createSubmodulesFromScope(self, scope, os): + def createSubmodulesFromScope(self, scope, os, module_whitelist = []): submodules = [] for dep in scope: url = '' @@ -39,10 +39,11 @@ class SubmoduleDEPSParser(resolver.DEPSParser): url = scope[dep] elif (type(scope[dep]) == dict and 'url' in scope[dep]): url = scope[dep]['url'] + if ('condition' in scope[dep]) and \ (not 'checkout_linux' in scope[dep]['condition']) and \ - (not 'checkout_android_native_support' in scope[dep]['condition']): - url = '' + (not dep in module_whitelist): + continue if url: url = url.format(**self.get_vars()) repo_rev = url.split('@') @@ -67,11 +68,11 @@ class SubmoduleDEPSParser(resolver.DEPSParser): submodules.append(submodule) return submodules - def parse(self, deps_content): + def parse(self, deps_content, module_whitelist = []): exec(deps_content, self.global_scope, self.local_scope) submodules = [] - submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps'], 'all')) + submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps'], 'all', module_whitelist)) if 'deps_os' in self.local_scope: for os_dep in self.local_scope['deps_os']: submodules.extend(self.createSubmodulesFromScope(self.local_scope['deps_os'][os_dep], os_dep)) |