Commit ee69a3bd authored by mgiuca's avatar mgiuca Committed by Commit bot

NaCl SDK: Fixed getos.py crashing due to Git migration.

Was trying to parse a Git commit hash as an int.

getos --check-version no longer compares exact revision numbers, only
major version numbers (because the Git hashes can't directly be
compared, unlike SVN numbers). Added a TODO to compare
Cr-Commit-Position when it becomes available.

BUG=406993

Review URL: https://codereview.chromium.org/502883002

Cr-Commit-Position: refs/heads/master@{#291888}
parent 2d454cf9
...@@ -80,7 +80,6 @@ def GetSDKVersion(): ...@@ -80,7 +80,6 @@ def GetSDKVersion():
raise Error("error parsing SDK README: %s" % readme) raise Error("error parsing SDK README: %s" % readme)
try: try:
revision = int(revision)
version = int(version) version = int(version)
except ValueError: except ValueError:
raise Error("error parsing SDK README: %s" % readme) raise Error("error parsing SDK README: %s" % readme)
...@@ -233,10 +232,14 @@ def main(args): ...@@ -233,10 +232,14 @@ def main(args):
elif options.check_version: elif options.check_version:
required_version = ParseVersion(options.check_version) required_version = ParseVersion(options.check_version)
version = GetSDKVersion() version = GetSDKVersion()
if version < required_version: # We currently ignore the revision and just check the major version number.
raise Error("SDK version too old (current: %s.%s, required: %s.%s)" # Currently, version[1] is just a Git hash, which cannot be compared.
% (version[0], version[1], # TODO(mgiuca): Compare the minor revision numbers (which should be
required_version[0], required_version[1])) # Cr-Commit-Position values), when http://crbug.com/406783 is fixed.
# Then Cr-Commit-Position should be available: see http://crbug.com/406993.
if version[0] < required_version[0]:
raise Error("SDK version too old (current: %s, required: %s)"
% (version[0], required_version[0]))
out = None out = None
if out: if out:
......
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