diff options
author | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 19:57:10 +0000 |
---|---|---|
committer | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-09 19:57:10 +0000 |
commit | 4c72e4e923a7a036ef74a19b76d94b2536ecab8e (patch) | |
tree | 1d92ea2f342be848311d1f22606dc060d6315652 /native_client_sdk/src | |
parent | d63534e9ed55137da3d1e92d3c744bd0295901e3 (diff) | |
download | chromium_src-4c72e4e923a7a036ef74a19b76d94b2536ecab8e.zip chromium_src-4c72e4e923a7a036ef74a19b76d94b2536ecab8e.tar.gz chromium_src-4c72e4e923a7a036ef74a19b76d94b2536ecab8e.tar.bz2 |
[NaCl SDK] Update sdk_tools to 160493->174973. Also added script to make updating sdk_tools easier.
BUG=none
R=noelallen@chromium.org
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11759011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk/src')
3 files changed, 329 insertions, 201 deletions
diff --git a/native_client_sdk/src/build_tools/json/naclsdk_manifest0.json b/native_client_sdk/src/build_tools/json/naclsdk_manifest0.json index cb62644..0a65613 100644 --- a/native_client_sdk/src/build_tools/json/naclsdk_manifest0.json +++ b/native_client_sdk/src/build_tools/json/naclsdk_manifest0.json @@ -1,39 +1,39 @@ { "bundles": [ { - "name": "sdk_tools", - "description": "Native Client SDK Tools, revision 160493", - "stability": "stable", - "recommended": "yes", - "version": 1, + "name": "sdk_tools", + "description": "Native Client SDK Tools, revision 174973", + "stability": "stable", + "recommended": "yes", + "version": 1, "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.160493/sdk_tools.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.174973/sdk_tools.tgz", "checksum": { - "sha1": "98799f2f2603d57a8b386f3898b0d69baa376448" - }, - "host_os": "mac", - "size": 25955 - }, + "sha1": "2e4dfe3f5276784677ec9ecc565b9b107bde2bd3" + }, + "host_os": "mac", + "size": 31934 + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.160493/sdk_tools.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.174973/sdk_tools.tgz", "checksum": { - "sha1": "98799f2f2603d57a8b386f3898b0d69baa376448" - }, - "host_os": "linux", - "size": 25955 - }, + "sha1": "2e4dfe3f5276784677ec9ecc565b9b107bde2bd3" + }, + "host_os": "linux", + "size": 31934 + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.160493/sdk_tools.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.174973/sdk_tools.tgz", "checksum": { - "sha1": "98799f2f2603d57a8b386f3898b0d69baa376448" - }, - "host_os": "win", - "size": 25955 + "sha1": "2e4dfe3f5276784677ec9ecc565b9b107bde2bd3" + }, + "host_os": "win", + "size": 31934 } - ], - "revision": 160493 + ], + "revision": 174973 } - ], + ], "manifest_version": 2 -} +}
\ No newline at end of file diff --git a/native_client_sdk/src/build_tools/json/naclsdk_manifest2.json b/native_client_sdk/src/build_tools/json/naclsdk_manifest2.json index 1551086..eca1034 100644 --- a/native_client_sdk/src/build_tools/json/naclsdk_manifest2.json +++ b/native_client_sdk/src/build_tools/json/naclsdk_manifest2.json @@ -1,280 +1,280 @@ { "bundles": [ { - "name": "sdk_tools", - "description": "Native Client SDK Tools, revision 160493", - "stability": "stable", - "recommended": "yes", - "version": 1, + "name": "sdk_tools", + "description": "Native Client SDK Tools, revision 174973", + "stability": "stable", + "recommended": "yes", + "version": 1, "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.160493/sdk_tools.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.174973/sdk_tools.tgz", "checksum": { - "sha1": "98799f2f2603d57a8b386f3898b0d69baa376448" - }, - "host_os": "mac", - "size": 25955 - }, + "sha1": "2e4dfe3f5276784677ec9ecc565b9b107bde2bd3" + }, + "host_os": "mac", + "size": 31934 + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.160493/sdk_tools.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.174973/sdk_tools.tgz", "checksum": { - "sha1": "98799f2f2603d57a8b386f3898b0d69baa376448" - }, - "host_os": "linux", - "size": 25955 - }, + "sha1": "2e4dfe3f5276784677ec9ecc565b9b107bde2bd3" + }, + "host_os": "linux", + "size": 31934 + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.160493/sdk_tools.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.174973/sdk_tools.tgz", "checksum": { - "sha1": "98799f2f2603d57a8b386f3898b0d69baa376448" - }, - "host_os": "win", - "size": 25955 + "sha1": "2e4dfe3f5276784677ec9ecc565b9b107bde2bd3" + }, + "host_os": "win", + "size": 31934 } - ], - "revision": 160493 - }, + ], + "revision": 174973 + }, { - "name": "gdb_builds", - "description": "gdb (Gnu Debugger) build for debugging x86-64 binary from win64 host", - "stability": "beta", - "recommended": "no", - "version": 0, + "name": "gdb_builds", + "description": "gdb (Gnu Debugger) build for debugging x86-64 binary from win64 host", + "stability": "beta", + "recommended": "no", + "version": 0, "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/gdb_builds/0.1/gdb-win-builds.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/gdb_builds/0.1/gdb-win-builds.tgz", "checksum": { "sha1": "94c78870edcd50f95bb0db040252e766bb275c50" - }, - "host_os": "win", + }, + "host_os": "win", "size": 34727612 } - ], + ], "revision": 1 - }, + }, { - "name": "vs_addin", - "description": "Visual Studio Add-In for building and debugging NaCl applications", - "stability": "dev", - "recommended": "no", - "version": 0, - "repath": "vs_addin", + "name": "vs_addin", + "description": "Visual Studio Add-In for building and debugging NaCl applications", + "stability": "dev", + "recommended": "no", + "version": 0, + "repath": "vs_addin", "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/sdk/${revision}/vs_addin.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/sdk/${revision}/vs_addin.tgz", "host_os": "win" } - ], + ], "revision": 1454 - }, + }, { - "name": "pepper_16", - "description": "Chrome 16 bundle, revision 1398", - "stability": "post_stable", - "recommended": "no", - "version": 16, + "name": "pepper_16", + "description": "Chrome 16 bundle, revision 1398", + "stability": "post_stable", + "recommended": "no", + "version": 16, "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/pepper_16_1398/naclsdk_mac.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/pepper_16_1398/naclsdk_mac.tgz", "checksum": { "sha1": "2fd1fefaea8e583d54b221929c45833d20309ec3" - }, - "host_os": "mac", + }, + "host_os": "mac", "size": 150292794 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/pepper_16_1398/naclsdk_linux.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/pepper_16_1398/naclsdk_linux.tgz", "checksum": { "sha1": "222e11cbc6406209936cad26f4013dfa33eb77cf" - }, - "host_os": "linux", + }, + "host_os": "linux", "size": 151546130 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/pepper_16_1398/naclsdk_win.exe", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/pepper_16_1398/naclsdk_win.exe", "checksum": { "sha1": "76088b2c4c6ca0fbac3c3fd68930c9a94a25351a" - }, - "host_os": "win", + }, + "host_os": "win", "size": 64343834 } - ], + ], "revision": 1398 - }, + }, { - "name": "pepper_17", - "description": "Chrome 17 bundle, revision 112997", - "stability": "post_stable", - "recommended": "no", - "version": 17, + "name": "pepper_17", + "description": "Chrome 17 bundle, revision 112997", + "stability": "post_stable", + "recommended": "no", + "version": 17, "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.112997/naclsdk_mac.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.112997/naclsdk_mac.tgz", "checksum": { "sha1": "ca8f1462d273405d87de857cad82c9964285c3a8" - }, - "host_os": "mac", + }, + "host_os": "mac", "size": 143931310 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.112997/naclsdk_linux.tgz", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.112997/naclsdk_linux.tgz", "checksum": { "sha1": "610200cb6c64556099936aaa4ac660b782a8c170" - }, - "host_os": "linux", + }, + "host_os": "linux", "size": 142672469 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.112997/naclsdk_win.exe", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/trunk.112997/naclsdk_win.exe", "checksum": { "sha1": "6690ad707fe22ea7709d7411af2815ab35036e86" - }, - "host_os": "win", + }, + "host_os": "win", "size": 55142078 } - ], + ], "revision": 112997 - }, + }, { - "name": "pepper_18", - "description": "Chrome 18 bundle, revision 124251", - "stability": "post_stable", - "recommended": "no", - "version": 18, - "repath": "pepper_18", + "name": "pepper_18", + "description": "Chrome 18 bundle, revision 124251", + "stability": "post_stable", + "recommended": "no", + "version": 18, + "repath": "pepper_18", "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/18.0.1025.46/naclsdk_mac.bz2", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/18.0.1025.46/naclsdk_mac.bz2", "checksum": { "sha1": "6ff19441a604d4e2a4faae27602e33c5bc4b56b5" - }, - "host_os": "mac", + }, + "host_os": "mac", "size": 113524972 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/18.0.1025.46/naclsdk_linux.bz2", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/18.0.1025.46/naclsdk_linux.bz2", "checksum": { "sha1": "0d172df865e17c6dfb0bebe9efac3f0da8ddf14f" - }, - "host_os": "linux", + }, + "host_os": "linux", "size": 113393279 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/18.0.1025.46/naclsdk_win.bz2", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/18.0.1025.46/naclsdk_win.bz2", "checksum": { "sha1": "67574e5a8dcbc967993be46819b22795e8dc11de" - }, - "host_os": "win", + }, + "host_os": "win", "size": 108888118 } - ], + ], "revision": 124253 - }, + }, { - "name": "pepper_19", - "description": "Chrome 19 bundle, revision 129248", - "stability": "post_stable", - "recommended": "no", - "version": 19, - "repath": "pepper_19", + "name": "pepper_19", + "description": "Chrome 19 bundle, revision 129248", + "stability": "post_stable", + "recommended": "no", + "version": 19, + "repath": "pepper_19", "archives": [ { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/19.0.1084.33/naclsdk_mac.bz2", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/19.0.1084.33/naclsdk_mac.bz2", "checksum": { "sha1": "b39038bf3775c6db907c6b99d722b5dac37f6e50" - }, - "host_os": "mac", + }, + "host_os": "mac", "size": 117551214 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/19.0.1084.33/naclsdk_linux.bz2", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/19.0.1084.33/naclsdk_linux.bz2", "checksum": { "sha1": "9a06afe74188b3c84215e6f5f9b46b3167d22b13" - }, - "host_os": "linux", + }, + "host_os": "linux", "size": 117846180 - }, + }, { - "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/19.0.1084.33/naclsdk_win.bz2", + "url": "https://commondatastorage.googleapis.com/nativeclient-mirror/nacl/nacl_sdk/19.0.1084.33/naclsdk_win.bz2", "checksum": { "sha1": "77b1787d38202427417c9e358cd55d4e6a73a9a0" - }, - "host_os": "win", + }, + "host_os": "win", "size": 113168433 } - ], + ], "revision": 129248 - }, + }, { - "name": "pepper_20", - "description": "Chrome 20 bundle, revision xxxxx", - "stability": "post_stable", - "recommended": "no", - "version": 20, - "repath": "pepper_20", - "archives": [], + "name": "pepper_20", + "description": "Chrome 20 bundle, revision xxxxx", + "stability": "post_stable", + "recommended": "no", + "version": 20, + "repath": "pepper_20", + "archives": [], "revision": 0 - }, + }, { - "name": "pepper_21", - "description": "Chrome 21 bundle, revision xxxxx", - "stability": "post_stable", - "recommended": "no", - "version": 21, - "repath": "pepper_21", - "archives": [], + "name": "pepper_21", + "description": "Chrome 21 bundle, revision xxxxx", + "stability": "post_stable", + "recommended": "no", + "version": 21, + "repath": "pepper_21", + "archives": [], "revision": 0 - }, + }, { - "name": "pepper_22", - "description": "Chrome 22 bundle, revision xxxxx", - "stability": "post_stable", - "recommended": "no", - "version": 22, - "repath": "pepper_22", - "archives": [], + "name": "pepper_22", + "description": "Chrome 22 bundle, revision xxxxx", + "stability": "post_stable", + "recommended": "no", + "version": 22, + "repath": "pepper_22", + "archives": [], "revision": 0 - }, + }, { - "name": "pepper_23", - "description": "Chrome 23 bundle, revision xxxxx", - "stability": "stable", - "recommended": "yes", - "version": 23, - "repath": "pepper_23", - "archives": [], + "name": "pepper_23", + "description": "Chrome 23 bundle, revision xxxxx", + "stability": "stable", + "recommended": "yes", + "version": 23, + "repath": "pepper_23", + "archives": [], "revision": 0 - }, + }, { - "name": "pepper_24", - "description": "Chrome 24 bundle, revision xxxxx", - "stability": "beta", - "recommended": "no", - "version": 24, - "repath": "pepper_24", - "archives": [], + "name": "pepper_24", + "description": "Chrome 24 bundle, revision xxxxx", + "stability": "beta", + "recommended": "no", + "version": 24, + "repath": "pepper_24", + "archives": [], "revision": 0 - }, + }, { - "name": "pepper_25", - "description": "Chrome 25 bundle, revision xxxxx", - "stability": "dev", - "recommended": "no", - "version": 25, - "repath": "pepper_25", - "archives": [], + "name": "pepper_25", + "description": "Chrome 25 bundle, revision xxxxx", + "stability": "dev", + "recommended": "no", + "version": 25, + "repath": "pepper_25", + "archives": [], "revision": 0 - }, + }, { - "name": "pepper_canary", - "description": "Chrome Canary", - "stability": "canary", - "recommended": "no", - "version": 0, - "repath": "", - "archives": [], + "name": "pepper_canary", + "description": "Chrome Canary", + "stability": "canary", + "recommended": "no", + "version": 0, + "repath": "", + "archives": [], "revision": 0 } - ], + ], "manifest_version": 2 -} +}
\ No newline at end of file diff --git a/native_client_sdk/src/build_tools/update_sdktools.py b/native_client_sdk/src/build_tools/update_sdktools.py new file mode 100755 index 0000000..95f08b8 --- /dev/null +++ b/native_client_sdk/src/build_tools/update_sdktools.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python +# 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. + +"""Script that reads omahaproxy and gsutil to determine a version of the +sdk_tools bundle to use. + +Please note the differences between this script and update_nacl_manifest.py: + +update_sdktools.py is run by a SDK-team developer to assist in updating to a +new sdk_tools bundle. A file on the developer's hard drive is modified, and +must be checked in for the new sdk_tools bundle to be used. + +update_nacl_manifest.py is customarily run by a cron job, and does not check in +any changes. Instead it modifies the manifest file in commondatastorage.""" + + +import collections +import difflib +import json +from manifest_util import DownloadAndComputeHash +import optparse +import re +import sys +from update_nacl_manifest import RealDelegate +import urllib2 + + +SDK_TOOLS_DESCRIPTION_FORMAT = 'Native Client SDK Tools, revision %d' +BUCKET_PATH = 'nativeclient-mirror/nacl/nacl_sdk/' +GS_BUCKET_PATH = 'gs://' + BUCKET_PATH +HTTPS_BUCKET_PATH = 'https://commondatastorage.googleapis.com/' + BUCKET_PATH + + +def GetSdkToolsUrl(revision): + return HTTPS_BUCKET_PATH + 'trunk.%d/sdk_tools.tgz' % revision + + +def GetTrunkRevisions(delegate): + urls = delegate.GsUtil_ls(GS_BUCKET_PATH) + revisions = [] + for url in urls: + m = re.match(GS_BUCKET_PATH + 'trunk\.(\d+)', url) + if m: + revisions.append((int(m.group(1)), url)) + return sorted(revisions) + + +def FindMostRecentSdkTools(delegate): + for revision, url in reversed(GetTrunkRevisions(delegate)): + sdktools_url = url + 'sdk_tools.tgz' + if delegate.GsUtil_ls(sdktools_url): + return revision, sdktools_url + return None + + +def JsonLoadFromString(json_string): + if sys.version_info > (2, 7): + return json.loads(json_string, object_pairs_hook=collections.OrderedDict) + else: + return json.loads(json_string) + + +def GetBundleByName(bundles, name): + for bundle in bundles: + if bundle['name'] == name: + return bundle + return None + + +def UpdateSdkToolsBundle(sdk_tools_bundle, revision, url, sha1, size): + sdk_tools_bundle['description'] = SDK_TOOLS_DESCRIPTION_FORMAT % revision + sdk_tools_bundle['revision'] = revision + # Update archive for each OS + for archive in sdk_tools_bundle['archives']: + archive['url'] = url + archive['checksum']['sha1'] = sha1 + archive['size'] = size + + +def UpdateManifest(manifest, revision): + sdk_tools_bundle = GetBundleByName(manifest['bundles'], 'sdk_tools') + url = GetSdkToolsUrl(revision) + sha1, size = DownloadAndComputeHash(urllib2.urlopen(url)) + UpdateSdkToolsBundle(sdk_tools_bundle, revision, url, sha1, size) + + +def UpdateManifestFileToRevision(filename, revision): + with open(filename) as stream: + manifest_string = stream.read() + + manifest = JsonLoadFromString(manifest_string) + UpdateManifest(manifest, revision) + new_manifest_string = json.dumps(manifest, indent=2) + + diff_string = ''.join(difflib.unified_diff(manifest_string.splitlines(1), + new_manifest_string.splitlines(1))) + + print 'diff %s' % filename + print diff_string + print + + with open(filename, 'w') as stream: + stream.write(new_manifest_string) + + +def main(args): + parser = optparse.OptionParser() + parser.add_option('-r', '--revision', + help='set revision manually, rather than using the latest version') + options, args = parser.parse_args(args[1:]) + if len(args) != 0: + parser.error('Unexpected args: %s' % ', '.join(args)) + + # TODO(binji): http://crbug.com/169047. Rename RealDelegate to something else. + delegate = RealDelegate() + if not options.revision: + revision, _ = FindMostRecentSdkTools(delegate) + else: + revision = int(options.revision) + + UpdateManifestFileToRevision('json/naclsdk_manifest0.json', revision) + UpdateManifestFileToRevision('json/naclsdk_manifest2.json', revision) + + +if __name__ == '__main__': + sys.exit(main(sys.argv)) |