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

Unified Diff: native_client_sdk/src/build_tools/sdk_tools/commands/info.py

Issue 11228013: [NaCl SDK] Refactor sdk_update*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests pass Created 8 years, 2 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
Index: native_client_sdk/src/build_tools/sdk_tools/commands/info.py
diff --git a/native_client_sdk/src/build_tools/sdk_tools/commands/info.py b/native_client_sdk/src/build_tools/sdk_tools/commands/info.py
new file mode 100644
index 0000000000000000000000000000000000000000..fbf578eda8f8e07f7825ce1d4c10b7111c44fbf6
--- /dev/null
+++ b/native_client_sdk/src/build_tools/sdk_tools/commands/info.py
@@ -0,0 +1,34 @@
+# 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.
+
+import logging
+import manifest_util
+
+
+def Info(manifest, bundle_names):
+ valid_bundles = [bundle.name for bundle in manifest.GetBundles()]
+ valid_bundles = set(bundle_names) & set(valid_bundles)
+ invalid_bundles = set(bundle_names) - valid_bundles
+ if invalid_bundles:
+ logging.warn('Unknown bundle(s): %s\n' % (', '.join(invalid_bundles)))
+
+ for bundle_name in bundle_names:
+ if bundle_name not in valid_bundles:
+ continue
+
+ bundle = manifest.GetBundle(bundle_name)
+
+ print bundle.name
+ for key, value in bundle.iteritems():
+ if key == manifest_util.ARCHIVES_KEY:
+ archive = bundle.GetHostOSArchive()
+ print ' Archive:'
+ if archive:
+ for archive_key, archive_value in archive.iteritems():
+ print ' %s: %s' % (archive_key, archive_value)
+ else:
+ print ' No archives for this host.'
+ elif key not in (manifest_util.ARCHIVES_KEY, manifest_util.NAME_KEY):
+ print ' %s: %s' % (key, value)
+ print

Powered by Google App Engine
This is Rietveld 408576698