diff options
author | dspringer@chromium.org <dspringer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-09 17:32:31 +0000 |
---|---|---|
committer | dspringer@chromium.org <dspringer@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-09 17:32:31 +0000 |
commit | e12f7d67573228f47778351c7e5536fb3421a53d (patch) | |
tree | 7cdecefc955a177b58e9400f30b4bc97f7ee0cd3 /native_client_sdk | |
parent | 1965af4f256738e0364a10500f5e8c6fa0dbda4f (diff) | |
download | chromium_src-e12f7d67573228f47778351c7e5536fb3421a53d.zip chromium_src-e12f7d67573228f47778351c7e5536fb3421a53d.tar.gz chromium_src-e12f7d67573228f47778351c7e5536fb3421a53d.tar.bz2 |
Add a --archive-id option to update_manifest.py.
The --archive-id option allows you to specify the archive id that is used to
build the BigStore URL for the SDK tarballs. This id overrides the default
id that looks like "pepper_15_1347".
BUG=none
TEST=native_client_sdk/src/scons run_update_manifest_test
Review URL: http://codereview.chromium.org/8879042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@113815 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-x | native_client_sdk/src/build_tools/sdk_tools/update_manifest.py | 25 | ||||
-rwxr-xr-x | native_client_sdk/src/build_tools/tests/update_manifest_test.py | 13 |
2 files changed, 33 insertions, 5 deletions
diff --git a/native_client_sdk/src/build_tools/sdk_tools/update_manifest.py b/native_client_sdk/src/build_tools/sdk_tools/update_manifest.py index d020e0a2..0929688 100755 --- a/native_client_sdk/src/build_tools/sdk_tools/update_manifest.py +++ b/native_client_sdk/src/build_tools/sdk_tools/update_manifest.py @@ -52,7 +52,8 @@ BUILD_TOOLS_OUT = os.path.join(NACL_SDK_ROOT, 'scons-out', 'build', 'obj', BUNDLE_SDK_TOOLS = 'sdk_tools' BUNDLE_PEPPER_MATCHER = re.compile('^pepper_([0-9]+)$') -IGNORE_OPTIONS = set(['gsutil', 'manifest_file', 'upload', 'root_url']) +IGNORE_OPTIONS = set([ + 'archive_id', 'gsutil', 'manifest_file', 'upload', 'root_url']) class Error(Exception): @@ -133,7 +134,7 @@ class UpdateSDKManifest(sdk_update.SDKManifest): Args: options: the object containing the remaining unused options attributes. - bundl_name: The name of the bundle, or None if it's missing.''' + bundle_name: The name of the bundle, or None if it's missing.''' # Any option left in the list should have value = None for key, val in options.__dict__.items(): if val != None and key not in IGNORE_OPTIONS: @@ -277,8 +278,15 @@ class UpdateSDKManifestFile(sdk_update.SDKManifestFile): if options.desc is None: options.desc = ('Chrome %s bundle, revision %s' % (options.bundle_version, options.bundle_revision)) - root_url = '%s/pepper_%s_%s' % (options.root_url, options.bundle_version, - options.bundle_revision) + root_url = options.root_url + if options.archive_id: + # Support archive names like trunk.113440 or 17.0.963.3, which is how + # the Chrome builders archive things. + root_url = '/'.join([root_url, options.archive_id]) + else: + # This is the old archive naming scheme + root_url = '%s/pepper_%s_%s' % (root_url, options.bundle_version, + options.bundle_revision) options.mac_arch_url = '/'.join([root_url, 'naclsdk_mac.tgz']) options.linux_arch_url = '/'.join([root_url, 'naclsdk_linux.tgz']) options.win_arch_url = '/'.join([root_url, 'naclsdk_win.exe']) @@ -311,6 +319,13 @@ def main(argv): # Setup options parser.add_option( + '-a', '--archive-id', dest='archive_id', + default=None, + help='Archive identifier, produced by the Chromium builders; string ' + 'like "trunk.113440" or "17.0.963.3". Used with --root-url to ' + 'build the full archive URL. If not set the archive id defaults to ' + '"pepper_<version>_<revision>"') + parser.add_option( '-b', '--bundle-version', dest='bundle_version', type='int', default=None, @@ -348,7 +363,7 @@ def main(argv): '-r', '--recommended', dest='recommended', choices=sdk_update.YES_NO_LITERALS, default=None, - help='Required: whether this bundle is recommended. one of "yes" or "no"') + help='Required: whether this bundle is recommended. One of "yes" or "no"') parser.add_option( '-R', '--root-url', dest='root_url', default='http://commondatastorage.googleapis.com/nativeclient-mirror/' diff --git a/native_client_sdk/src/build_tools/tests/update_manifest_test.py b/native_client_sdk/src/build_tools/tests/update_manifest_test.py index 1022323..0e33207 100755 --- a/native_client_sdk/src/build_tools/tests/update_manifest_test.py +++ b/native_client_sdk/src/build_tools/tests/update_manifest_test.py @@ -62,6 +62,7 @@ def GetHTTPHandler(path, length=None): class FakeOptions(object): ''' Just a place holder for options ''' def __init__(self): + self.archive_id = None self.bundle_desc_url = None self.bundle_name = None self.bundle_version = None @@ -338,6 +339,18 @@ class TestUpdateManifest(unittest.TestCase): manifest_object.HandleBundles() manifest_object.UpdateWithOptions() + # Verify that the bundle can be found via the --archive-id option. + options = FakeOptions() + options.archive_id = 'pepper_1_0' + options.bundle_name = 'pepper_phony' + options.bundle_version = -1 + options.bundle_revision = -1 + options.stability = 'dev' + options.recommended = 'no' + manifest_object = update_manifest.UpdateSDKManifestFile(options) + manifest_object.HandleBundles() + manifest_object.UpdateWithOptions() + def main(): suite = unittest.TestLoader().loadTestsFromTestCase(TestUpdateManifest) |