blob: 15f90ad8b101c5b4260436f8901ae2e0965cf48d [file] [log] [blame]
Ryan Cui0af7a912012-06-19 01:00:471#!/usr/bin/python
2
3# Copyright (c) 2009-2012 The Chromium OS Authors. All rights reserved.
4# Use of this source code is governed by a BSD-style license that can be
5# found in the LICENSE file.
6
7"""Script that strips a given package and places the stripped version in
8 /build/<board>/stripped-packages."""
9
Ryan Cui0af7a912012-06-19 01:00:4710import optparse
Yu-Ju Honge2b3f742013-11-08 19:33:0911import sys
Ryan Cui0af7a912012-06-19 01:00:4712
Gilad Arnoldabb352e2012-09-23 08:24:2713import builder
14
Ryan Cui0af7a912012-06-19 01:00:4715
16def main():
17 parser = optparse.OptionParser(usage='usage: %prog [options] package')
18 parser.add_option('--board', type='string', action='store',
19 help=('The board that the package being processed belongs '
20 'to.'))
21 parser.add_option('--deep', action='store_true', default=False,
22 help=('Also strip dependencies of package.'))
23
24 (options, args) = parser.parse_args()
25 if len(args) != 1:
26 parser.print_help()
27 parser.error('Need exactly one package name')
28
29 if not options.board:
30 parser.error('Need to specify --board')
31
Yu-Ju Honge2b3f742013-11-08 19:33:0932 # Check if package was installed.
33 if not builder.UpdateGmergeBinhost(options.board, args[0], options.deep):
34 sys.exit(1)
Ryan Cui0af7a912012-06-19 01:00:4735
36
37if __name__ == '__main__':
38 main()