summaryrefslogtreecommitdiffstats
path: root/native_client_sdk
diff options
context:
space:
mode:
authorbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 23:14:44 +0000
committerbinji@chromium.org <binji@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-05 23:14:44 +0000
commit1f5839305086106f37afd15fdf39630c4379f350 (patch)
tree8613770594c2edbaf252d1629e186e01831fcf43 /native_client_sdk
parentbb5c4bff6d15efff2cd6ada7021b24e641f3b9d0 (diff)
downloadchromium_src-1f5839305086106f37afd15fdf39630c4379f350.zip
chromium_src-1f5839305086106f37afd15fdf39630c4379f350.tar.gz
chromium_src-1f5839305086106f37afd15fdf39630c4379f350.tar.bz2
[NaCl SDK] Fix bug in "naclsdk update", updating recommended bundles.
Running "naclsdk update" should only update bundles that are marked recommended == "yes". Also, the "sdk_tools" bundle is marked as recommended, but should not be added to this list (it is automatically updated). BUG=179648 R=sbc@chromium.org NOTRY=true Review URL: https://chromiumcodereview.appspot.com/12470004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'native_client_sdk')
-rw-r--r--native_client_sdk/src/build_tools/sdk_tools/command/update.py7
-rwxr-xr-xnative_client_sdk/src/build_tools/tests/sdktools_commands_test.py16
2 files changed, 17 insertions, 6 deletions
diff --git a/native_client_sdk/src/build_tools/sdk_tools/command/update.py b/native_client_sdk/src/build_tools/sdk_tools/command/update.py
index 7fa9066..3ae4f0d 100644
--- a/native_client_sdk/src/build_tools/sdk_tools/command/update.py
+++ b/native_client_sdk/src/build_tools/sdk_tools/command/update.py
@@ -212,8 +212,11 @@ def _GetRequestedBundleNamesFromArgs(remote_manifest, requested_bundles):
def _GetRecommendedBundleNames(remote_manifest):
- return [bundle.name for bundle in remote_manifest.GetBundles() if
- bundle.recommended]
+ result = []
+ for bundle in remote_manifest.GetBundles():
+ if bundle.recommended == 'yes' and bundle.name != SDK_TOOLS:
+ result.append(bundle.name)
+ return result
def _BundleNeedsUpdate(delegate, local_manifest, bundle):
diff --git a/native_client_sdk/src/build_tools/tests/sdktools_commands_test.py b/native_client_sdk/src/build_tools/tests/sdktools_commands_test.py
index 5a6c53b..15933e1 100755
--- a/native_client_sdk/src/build_tools/tests/sdktools_commands_test.py
+++ b/native_client_sdk/src/build_tools/tests/sdktools_commands_test.py
@@ -227,10 +227,18 @@ class TestCommands(SdkToolsTestCase):
"""The update command should update only recommended bundles when run
without args.
"""
- bundle = self._AddDummyBundle(self.manifest, 'pepper_26')
- bundle.recommended = 'yes'
+ bundle_25 = self._AddDummyBundle(self.manifest, 'pepper_25')
+ bundle_25.recommended = 'no'
+ bundle_26 = self._AddDummyBundle(self.manifest, 'pepper_26')
+ bundle_26.recommended = 'yes'
+
self._WriteManifest()
output = self._Run(['update'])
+
+ # Should not try to update sdk_tools (even though it is recommended)
+ self.assertTrue('Ignoring manual update request.' not in output)
+ self.assertFalse(os.path.exists(
+ os.path.join(self.basedir, 'nacl_sdk', 'pepper_25')))
self.assertTrue(os.path.exists(
os.path.join(self.basedir, 'nacl_sdk', 'pepper_26', 'dummy.txt')))
@@ -241,7 +249,7 @@ class TestCommands(SdkToolsTestCase):
bundle = self._AddDummyBundle(self.manifest, 'pepper_26')
bundle.name = 'pepper_canary'
self._WriteManifest()
- output = self._Run(['update'])
+ output = self._Run(['update', 'pepper_canary'])
self.assertTrue(os.path.exists(
os.path.join(self.basedir, 'nacl_sdk', 'pepper_canary', 'dummy.txt')))
@@ -255,7 +263,7 @@ class TestCommands(SdkToolsTestCase):
archive2.host_os = 'all'
bundle.AddArchive(archive2)
self._WriteManifest()
- output = self._Run(['update'])
+ output = self._Run(['update', 'pepper_26'])
self.assertTrue(os.path.exists(
os.path.join(self.basedir, 'nacl_sdk', 'pepper_26', 'dummy.txt')))
self.assertTrue(os.path.exists(