diff options
Diffstat (limited to 'tools/scripts/version_resolver.py')
-rw-r--r-- | tools/scripts/version_resolver.py | 103 |
1 files changed, 54 insertions, 49 deletions
diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py index 32c8be74c..ad71f06e2 100644 --- a/tools/scripts/version_resolver.py +++ b/tools/scripts/version_resolver.py @@ -1,32 +1,6 @@ #!/usr/bin/env python - -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtWebEngine module of the Qt Toolkit. -## -## $QT_BEGIN_LICENSE:GPL-EXCEPT$ -## Commercial License Usage -## Licensees holding valid commercial Qt licenses may use this file in -## accordance with the commercial license agreement provided with the -## Software or, alternatively, in accordance with the terms contained in -## a written agreement between you and The Qt Company. For licensing terms -## and conditions see https://www.qt.io/terms-conditions. For further -## information use the contact form at https://www.qt.io/contact-us. -## -## GNU General Public License Usage -## Alternatively, this file may be used under the terms of the GNU -## General Public License version 3 as published by the Free Software -## Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -## included in the packaging of this file. Please review the following -## information to ensure the GNU General Public License requirements will -## be met: https://www.gnu.org/licenses/gpl-3.0.html. -## -## $QT_END_LICENSE$ -## -############################################################################# +# Copyright (C) 2016 The Qt Company Ltd. +# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 import glob import os @@ -35,12 +9,42 @@ import shutil import subprocess import sys import json -import urllib2 +import urllib3 import git_submodule as GitSubmodule - -chromium_version = '83.0.4103.122' -chromium_branch = '4103' -ninja_version = 'v1.8.2' +from abc import ABC, abstractmethod + +class DEPSParser(ABC): + 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 = '' + + def subdir(self, dep): + if dep.startswith('src/'): + return dep[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) + return None + else: + return dep + + @abstractmethod + def parse(self): + pass + + def get_recursedeps(self): + return self.local_scope["recursedeps"] + + +chromium_version = '122.0.6261.171' +chromium_branch = '6261' json_url = 'http://omahaproxy.appspot.com/all.json' @@ -49,21 +53,24 @@ snapshot_src_dir = os.path.abspath(os.path.join(qtwebengine_root, 'src/3rdparty' upstream_src_dir = os.path.abspath(snapshot_src_dir + '_upstream') submodule_blacklist = [ - 'third_party/WebKit/LayoutTests/w3c/csswg-test' - , 'third_party/WebKit/LayoutTests/w3c/web-platform-tests' - , 'chrome/tools/test/reference_build/chrome_mac' - , 'chrome/tools/test/reference_build/chrome_linux' - , 'chrome/tools/test/reference_build/chrome_win' - ] + 'buildtools/clang_format/script', + 'buildtools/third_party/libc++/trunk', + 'buildtools/third_party/libc++abi/trunk', + 'buildtools/third_party/libunwind/trunk', + 'chrome/browser/resources/chromeos/quickoffice', + 'remoting/host/installer/linux/internal', + 'third_party/widevine/cdm/chromeos', + 'third_party/widevine/cdm/linux', + 'third_party/widevine/test/license_server', + 'ui/file_manager/internal' +] +submodule_whitelist = [ 'src/third_party/android_ndk' , 'src/third_party/libunwindstack' ] sys.path.append(os.path.join(qtwebengine_root, 'tools', 'scripts')) def currentVersion(): return chromium_version -def currentNinjaVersion(): - return ninja_version - def readReleaseChannels(): response = urllib2.urlopen(json_url) raw_json = response.read().strip() @@ -77,11 +84,11 @@ def readReleaseChannels(): channels[os].append({ 'channel': ver['channel'], 'version': ver['version'], 'branch': ver['true_branch'] }) return channels -def readSubmodules(): +def read(parserCls): git_deps = subprocess.check_output(['git', 'show', chromium_version +':DEPS']) - parser = GitSubmodule.DEPSParser() - git_submodules = parser.parse(git_deps) + parser = parserCls() + git_submodules = parser.parse(git_deps, submodule_whitelist) submodule_dict = {} @@ -89,8 +96,6 @@ def readSubmodules(): submodule_dict[sub.path] = sub extradeps_dirs = parser.get_recursedeps() - # Add buildtools submodules - extradeps_dirs.append('buildtools') for extradeps_dir in extradeps_dirs: if extradeps_dir.startswith('src/'): @@ -100,7 +105,7 @@ def readSubmodules(): with open(extra_deps_file_path, 'r') as extra_deps_file: extra_deps = extra_deps_file.read() if extra_deps: - extradeps_parser = GitSubmodule.DEPSParser() + extradeps_parser = parserCls() extradeps_parser.topmost_supermodule_path_prefix = extradeps_dir extradeps_submodules = extradeps_parser.parse(extra_deps) for sub in extradeps_submodules: @@ -165,7 +170,7 @@ def resetUpstream(): chromium = GitSubmodule.Submodule() chromium.path = "." - submodules = chromium.readSubmodules() + submodules = chromium.readSubmodules(True) submodules.append(chromium) print('-- resetting upstream submodules in ' + os.path.relpath(target_dir) + ' to baseline --') |