diff options
author | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-03 16:51:25 +0000 |
---|---|---|
committer | binji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-03 16:51:25 +0000 |
commit | 771f5de1f2307126a2b179ea640d40405be7660f (patch) | |
tree | c4f33126fca5366c20b4a39bfa4c2e78ba375841 /native_client_sdk | |
parent | 888d0f97233767c3cc187371094a6db1ba3d5560 (diff) | |
download | chromium_src-771f5de1f2307126a2b179ea640d40405be7660f.zip chromium_src-771f5de1f2307126a2b179ea640d40405be7660f.tar.gz chromium_src-771f5de1f2307126a2b179ea640d40405be7660f.tar.bz2 |
[NaCl SDK] The auto-updater should only mark one version as stable, everything
prior should be marked as post_stable.
BUG=156765
R=sbc@chromium.org
NOTRY=true
TBR=noelallen@chromium.org
Review URL: https://chromiumcodereview.appspot.com/11275081
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165856 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rwxr-xr-x | native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py | 16 | ||||
-rwxr-xr-x | native_client_sdk/src/build_tools/update_nacl_manifest.py | 14 |
2 files changed, 28 insertions, 2 deletions
diff --git a/native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py b/native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py index 11b565d..b5e931f 100755 --- a/native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py +++ b/native_client_sdk/src/build_tools/tests/test_update_nacl_manifest.py @@ -31,6 +31,7 @@ OS_M = ('mac',) OS_ML = ('mac', 'linux') OS_MW = ('mac', 'win') OS_MLW = ('mac', 'linux', 'win') +POST_STABLE = 'post_stable' STABLE = 'stable' BETA = 'beta' DEV = 'dev' @@ -515,6 +516,20 @@ mac,canary,21.0.1156.0,2012-05-30 12:14:21.305090""" self._AssertUploadedManifestHasBundle(bundle, BETA) self.assertEqual(len(self.uploaded_manifest.GetBundles()), 1) + def testOnlyOneStableBundle(self): + self.manifest = MakeManifest(B18_R1_NONE, B19_R1_NONE) + self.history.Add(OS_MLW, STABLE, V18_0_1025_163) + self.history.Add(OS_MLW, STABLE, V19_0_1084_41) + self.files.Add(B18_0_1025_163_R1_MLW) + self.files.Add(B19_0_1084_41_R1_MLW) + self._MakeDelegate() + self._Run(OS_MLW) + self._ReadUploadedManifest() + p18_bundle = self.uploaded_manifest.GetBundle(B18_R1_NONE.name) + self.assertEqual(p18_bundle.stability, POST_STABLE) + p19_bundle = self.uploaded_manifest.GetBundle(B19_R1_NONE.name) + self.assertEqual(p19_bundle.stability, STABLE) + class TestUpdateVitals(unittest.TestCase): def setUp(self): @@ -538,7 +553,6 @@ class TestUpdateVitals(unittest.TestCase): # (file:///C:\whatever) path = '/' + path archive.url = 'file://' + path - print archive.url bundle = MakeBundle(18) bundle.AddArchive(archive) diff --git a/native_client_sdk/src/build_tools/update_nacl_manifest.py b/native_client_sdk/src/build_tools/update_nacl_manifest.py index 4b05a00..c8fb442 100755 --- a/native_client_sdk/src/build_tools/update_nacl_manifest.py +++ b/native_client_sdk/src/build_tools/update_nacl_manifest.py @@ -479,6 +479,13 @@ class Updater(object): Args: manifest: The manifest used as a template for updating. Only pepper bundles that contain no archives will be considered for auto-updating.""" + # Make sure there is only one stable branch: the one with the max version. + # All others are post-stable. + stable_major_versions = [SplitVersion(version)[0] for _, version, channel, _ + in self.versions_to_update if channel == 'stable'] + # Add 0 in case there are no stable versions. + max_stable_version = max([0] + stable_major_versions) + for bundle_name, version, channel, archives in self.versions_to_update: self.delegate.Print('Updating %s to %s...' % (bundle_name, version)) bundle = manifest.GetBundle(bundle_name) @@ -489,7 +496,12 @@ class Updater(object): # snippet. platform_bundle.name = bundle_name bundle.MergeWithBundle(platform_bundle) - bundle.stability = channel + + major_version = SplitVersion(version)[0] + if major_version < max_stable_version and channel == 'stable': + bundle.stability = 'post_stable' + else: + bundle.stability = channel # We always recommend the stable version. if channel == 'stable': bundle.recommended = 'yes' |