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

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

Issue 495423010: [NaCl SDK] Update build_sdk.py to display Cr-Commit-Position in README. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
« no previous file with comments | « native_client_sdk/src/build_tools/build_version.py ('k') | native_client_sdk/src/tools/tests/getos_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f14e02e0630494da2158a9bbacab2275fda9a9d1 100755
--- a/native_client_sdk/src/tools/getos.py
+++ b/native_client_sdk/src/tools/getos.py
@@ -68,6 +68,7 @@ def GetSDKVersion():
version = None
revision = None
+ commit_position = None
for line in open(readme):
if ':' in line:
name, value = line.split(':', 1)
@@ -75,8 +76,10 @@ def GetSDKVersion():
version = value.strip()
if name == "Chrome Revision":
revision = value.strip()
+ if name == "Chrome Commit Position":
+ commit_position = value.strip()
- if revision == None or version == None:
+ if revision is None or version is None or commit_position is None:
raise Error("error parsing SDK README: %s" % readme)
try:
@@ -84,7 +87,7 @@ def GetSDKVersion():
except ValueError:
raise Error("error parsing SDK README: %s" % readme)
- return (version, revision)
+ return (version, revision, commit_position)
def GetSystemArch(platform):
@@ -204,6 +207,8 @@ def main(args):
help='Print major version of the NaCl SDK.')
parser.add_option('--sdk-revision', action='store_true',
help='Print revision number of the NaCl SDK.')
+ parser.add_option('--sdk-commit-position', action='store_true',
+ help='Print commit position of the NaCl SDK.')
parser.add_option('--check-version',
help='Check that the SDK version is at least as great as the '
'version passed in.')
@@ -229,6 +234,8 @@ def main(args):
out = GetSDKVersion()[0]
elif options.sdk_revision:
out = GetSDKVersion()[1]
+ elif options.sdk_commit_position:
+ out = GetSDKVersion()[2]
elif options.check_version:
required_version = ParseVersion(options.check_version)
version = GetSDKVersion()
« no previous file with comments | « native_client_sdk/src/build_tools/build_version.py ('k') | native_client_sdk/src/tools/tests/getos_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698