summaryrefslogtreecommitdiff
path: root/tools/scripts/git_submodule.py
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2023-02-16 11:19:34 +0100
committerMichal Klocek <michal.klocek@qt.io>2023-02-23 03:29:13 +0100
commit7e4cd3a66fb3a8ef4eab64a9f067f90db2a4cb52 (patch)
tree0519fc191eb6121150d96aa37d547aea46c5f4e9 /tools/scripts/git_submodule.py
parent53162b8a1c2b02bb572e0e7d93c9d1493c74287e (diff)
downloadqtwebengine-7e4cd3a66fb3a8ef4eab64a9f067f90db2a4cb52.tar.gz
Add cipd handling to init-repository and take_snapshot
Add parsing deps for packages deployed by cipd. Keep changes to minimum as we so far need just one androidx package. All the package files are filtered by the chromium black list. Whitelist pydeps and info files for android dependencies, as this minimizes required changes to gn build files, add icu file for android. Update the version to 108.0.5359.181 as it was outdated. Cipd package parsing is done only for androidx package and the logic runs for * init-repository --baseline-upstream > cipd downloads and extracts androidx package to upstream repository * take-snapshot > cipd returns content so it can got through blacklist lists (files are not in git so git ls-file does not help here) Task-number: QTBUG-83459 Change-Id: I7b8203bfb273ba90113a449725ba9ea5c9a6692c Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'tools/scripts/git_submodule.py')
-rw-r--r--tools/scripts/git_submodule.py32
1 files changed, 8 insertions, 24 deletions
diff --git a/tools/scripts/git_submodule.py b/tools/scripts/git_submodule.py
index 07b5eb756..b2c21de27 100644
--- a/tools/scripts/git_submodule.py
+++ b/tools/scripts/git_submodule.py
@@ -18,15 +18,9 @@ def subprocessCheckOutput(args):
print(args)
return subprocess.check_output(args).decode()
-class DEPSParser:
+class SubmoduleDEPSParser(resolver.DEPSParser):
def __init__(self):
- self.global_scope = {
- 'Var': lambda var_name: '{%s}' % var_name,
- 'Str': str,
- 'deps_os': {},
- }
- self.local_scope = {}
- self.topmost_supermodule_path_prefix = ''
+ super().__init__()
def get_vars(self):
"""Returns a dictionary of effective variable values
@@ -37,9 +31,6 @@ 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:
@@ -48,25 +39,18 @@ class 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']):
+ if ('condition' in scope[dep]) and \
+ (not 'checkout_linux' in scope[dep]['condition']) and \
+ (not 'checkout_android_native_support' in scope[dep]['condition']):
url = ''
-
if url:
url = url.format(**self.get_vars())
repo_rev = url.split('@')
repo = repo_rev[0]
rev = repo_rev[1]
- subdir = dep
- if subdir.startswith('src/'):
- subdir = subdir[4:]
- # Don't skip submodules that have a supermodule path prefix set (at the moment these
- # are 2nd level deep submodules).
- elif not self.topmost_supermodule_path_prefix:
- # Ignore the information about chromium itself since we get that from git,
- # also ignore anything outside src/ (e.g. depot_tools)
+ subdir = self.subdir(dep)
+ if subdir is None:
continue
-
submodule = Submodule(subdir, repo, sp=self.topmost_supermodule_path_prefix)
submodule.os = os
@@ -294,7 +278,7 @@ class Submodule:
def readSubmodules(self, use_deps=False):
submodules = []
if use_deps:
- submodules = resolver.readSubmodules()
+ submodules = resolver.read(SubmoduleDEPSParser)
print('DEPS file provides the following submodules:')
for submodule in submodules:
print('{:<80}'.format(submodule.pathRelativeToTopMostSupermodule()) + '{:<120}'.format(submodule.url) + submodule.ref)