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
|
|