1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
9 import sdk_update_common
11 def Uninstall(install_dir
, local_manifest
, bundle_names
):
12 valid_bundles
, invalid_bundles
= \
13 command_common
.GetValidBundles(local_manifest
, bundle_names
)
15 logging
.warn('Unknown bundle(s): %s\n' % (', '.join(invalid_bundles
)))
18 logging
.warn('No bundles to uninstall.')
21 for bundle_name
in valid_bundles
:
22 logging
.info('Removing %s' % (bundle_name
,))
23 bundle_dir
= os
.path
.join(install_dir
, bundle_name
)
25 sdk_update_common
.RemoveDir(bundle_dir
)
26 except Exception as e
:
27 logging
.error('Failed to remove directory \"%s\". %s' % (bundle_dir
, e
))
29 local_manifest
.RemoveBundle(bundle_name
)