OLD | NEW |
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 def List(remote_manifest, local_manifest, display_revisions): | 5 def List(remote_manifest, local_manifest, display_revisions): |
6 any_bundles_need_update = False | 6 any_bundles_need_update = False |
7 print 'Bundles:' | 7 print 'Bundles:' |
8 print ' I: installed\n *: update available\n' | 8 print ' I: installed\n *: update available\n' |
9 for bundle in remote_manifest.GetBundles(): | 9 for bundle in remote_manifest.GetBundles(): |
10 local_bundle = local_manifest.GetBundle(bundle.name) | 10 local_bundle = local_manifest.GetBundle(bundle.name) |
11 needs_update = local_bundle and local_manifest.BundleNeedsUpdate(bundle) | 11 needs_update = local_bundle and local_manifest.BundleNeedsUpdate(bundle) |
12 if needs_update: | 12 if needs_update: |
13 any_bundles_need_update = True | 13 any_bundles_need_update = True |
14 | 14 |
15 _PrintBundle(local_bundle, bundle, needs_update, display_revisions) | 15 _PrintBundle(local_bundle, bundle, needs_update, display_revisions) |
16 | 16 |
17 if not any_bundles_need_update: | 17 if not any_bundles_need_update: |
18 print '\nAll installed bundles are up-to-date.' | 18 print '\nAll installed bundles are up to date.' |
19 | 19 |
20 local_only_bundles = set([b.name for b in local_manifest.GetBundles()]) | 20 local_only_bundles = set([b.name for b in local_manifest.GetBundles()]) |
21 local_only_bundles -= set([b.name for b in remote_manifest.GetBundles()]) | 21 local_only_bundles -= set([b.name for b in remote_manifest.GetBundles()]) |
22 if local_only_bundles: | 22 if local_only_bundles: |
23 print '\nBundles installed locally that are not available remotely:' | 23 print '\nBundles installed locally that are not available remotely:' |
24 for bundle_name in local_only_bundles: | 24 for bundle_name in local_only_bundles: |
25 local_bundle = local_manifest.GetBundle(bundle_name) | 25 local_bundle = local_manifest.GetBundle(bundle_name) |
26 _PrintBundle(local_bundle, None, False, display_revisions) | 26 _PrintBundle(local_bundle, None, False, display_revisions) |
27 | 27 |
28 | 28 |
(...skipping 10 matching lines...) Expand all Loading... |
39 revision = ' (r%s)' % (bundle.revision,) | 39 revision = ' (r%s)' % (bundle.revision,) |
40 else: | 40 else: |
41 revision = '' | 41 revision = '' |
42 | 42 |
43 print (' %s%s %s (%s)%s' % ( | 43 print (' %s%s %s (%s)%s' % ( |
44 'I' if installed else ' ', | 44 'I' if installed else ' ', |
45 '*' if needs_update else ' ', | 45 '*' if needs_update else ' ', |
46 bundle.name, | 46 bundle.name, |
47 bundle.stability, | 47 bundle.stability, |
48 revision)) | 48 revision)) |
OLD | NEW |