Commit cdd96213 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac: make find_sdk.py work when the sdk goes to 11

Bug: 1098738
Change-Id: Ibab53f0dd1c24e28f82d5b5d22abffc934a05782
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2264152
Commit-Queue: Nico Weber <thakis@chromium.org>
Commit-Queue: Mark Mentovai <mark@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#781835}
parent a7ca8229
...@@ -2,8 +2,7 @@ ...@@ -2,8 +2,7 @@
# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
r"""Prints the lowest locally available SDK version greater than or equal to a
"""Prints the lowest locally available SDK version greater than or equal to a
given minimum sdk version to standard output. given minimum sdk version to standard output.
If --print_sdk_path is passed, then the script will also print the SDK path. 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 ...@@ -11,8 +10,10 @@ If --print_bin_path is passed, then the script will also print the path to the
toolchain bin dir. toolchain bin dir.
Usage: Usage:
python find_sdk.py [--print_sdk_path] \ python find_sdk.py \
[--print_bin_path] 10.6 # Ignores SDKs < 10.6 [--print_sdk_path] \
[--print_bin_path] \
10.6 # Ignores SDKs < 10.6
Sample Output: Sample Output:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk
...@@ -72,7 +73,7 @@ def main(): ...@@ -72,7 +73,7 @@ def main():
raise SdkError('Install Xcode, launch it, accept the license ' + raise SdkError('Install Xcode, launch it, accept the license ' +
'agreement, and run `sudo xcode-select -s /path/to/Xcode.app` ' + 'agreement, and run `sudo xcode-select -s /path/to/Xcode.app` ' +
'to continue.') '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[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'] sdks = [s for s in sdks # ['10.5', '10.6'] => ['10.6']
if parse_version(s) >= parse_version(min_sdk_version)] if parse_version(s) >= parse_version(min_sdk_version)]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment