summaryrefslogtreecommitdiff
path: root/chromium/build/mac/find_sdk.py
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-12 14:27:29 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-10-13 09:35:20 +0000
commitc30a6232df03e1efbd9f3b226777b07e087a1122 (patch)
treee992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/build/mac/find_sdk.py
parent7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff)
downloadqtwebengine-chromium-85-based.tar.gz
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/build/mac/find_sdk.py')
-rwxr-xr-xchromium/build/mac/find_sdk.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/chromium/build/mac/find_sdk.py b/chromium/build/mac/find_sdk.py
index 78314e04dfe..58362bfa244 100755
--- a/chromium/build/mac/find_sdk.py
+++ b/chromium/build/mac/find_sdk.py
@@ -2,8 +2,7 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-
-"""Prints the lowest locally available SDK version greater than or equal to a
+r"""Prints the lowest locally available SDK version greater than or equal to a
given minimum sdk version to standard output.
If --print_sdk_path is passed, then the script will also print the SDK path.
@@ -11,8 +10,10 @@ If --print_bin_path is passed, then the script will also print the path to the
toolchain bin dir.
Usage:
- python find_sdk.py [--print_sdk_path] \
- [--print_bin_path] 10.6 # Ignores SDKs < 10.6
+ python find_sdk.py \
+ [--print_sdk_path] \
+ [--print_bin_path] \
+ 10.6 # Ignores SDKs < 10.6
Sample Output:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
@@ -39,7 +40,7 @@ class SdkError(Exception):
def parse_version(version_str):
"""'10.6' => [10, 6]"""
- return map(int, re.findall(r'(\d+)', version_str))
+ return [int(s) for s in re.findall(r'(\d+)', version_str)]
def main():
@@ -72,7 +73,7 @@ def main():
raise SdkError('Install Xcode, launch it, accept the license ' +
'agreement, and run `sudo xcode-select -s /path/to/Xcode.app` ' +
'to continue.')
- sdks = [re.findall('^MacOSX(10\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
+ sdks = [re.findall('^MacOSX(\d+\.\d+)\.sdk$', s) for s in os.listdir(sdk_dir)]
sdks = [s[0] for s in sdks if s] # [['10.5'], ['10.6']] => ['10.5', '10.6']
sdks = [s for s in sdks # ['10.5', '10.6'] => ['10.6']
if parse_version(s) >= parse_version(min_sdk_version)]