Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(991)

Unified Diff: native_client_sdk/src/tools/getos.py

Issue 506863005: [NaCl SDK] getos.py now checks against the Cr-Commit-Position. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sbc-nacl-sdk-fix-getos-tests
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: native_client_sdk/src/tools/getos.py
diff --git a/native_client_sdk/src/tools/getos.py b/native_client_sdk/src/tools/getos.py
index 62c2b5b7632043f2f4f600404729792acf948036..e9023e2a4cf9fa9592b1235eb40540a187d8bf87 100755
--- a/native_client_sdk/src/tools/getos.py
+++ b/native_client_sdk/src/tools/getos.py
@@ -191,6 +191,18 @@ def ParseVersion(version):
raise Error('error parsing SDK version: %s' % version)
+def CheckVersion(required_version):
+ version = GetSDKVersion()
+ # We currently ignore the revision and just check the major version number.
+ # Currently, version[1] is just a Git hash, which cannot be compared.
+ # TODO(mgiuca): Compare the minor revision numbers (which should be
+ # 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]))
+
+
def main(args):
parser = optparse.OptionParser()
parser.add_option('--arch', action='store_true',
@@ -231,15 +243,7 @@ def main(args):
out = GetSDKVersion()[1]
elif options.check_version:
required_version = ParseVersion(options.check_version)
- version = GetSDKVersion()
- # We currently ignore the revision and just check the major version number.
- # Currently, version[1] is just a Git hash, which cannot be compared.
- # TODO(mgiuca): Compare the minor revision numbers (which should be
- # 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]))
+ CheckVersion(required_version)
out = None
if out:
« no previous file with comments | « no previous file | native_client_sdk/src/tools/tests/getos_test.py » ('j') | native_client_sdk/src/tools/tests/getos_test.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698