Ryan Cui | 0af7a91 | 2012-06-19 01:00:47 | [diff] [blame] | 1 | #!/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 | |
| 10 | import builder |
| 11 | import optparse |
| 12 | |
| 13 | |
| 14 | def main(): |
| 15 | parser = optparse.OptionParser(usage='usage: %prog [options] package') |
| 16 | parser.add_option('--board', type='string', action='store', |
| 17 | help=('The board that the package being processed belongs ' |
| 18 | 'to.')) |
| 19 | parser.add_option('--deep', action='store_true', default=False, |
| 20 | help=('Also strip dependencies of package.')) |
| 21 | |
| 22 | (options, args) = parser.parse_args() |
| 23 | if len(args) != 1: |
| 24 | parser.print_help() |
| 25 | parser.error('Need exactly one package name') |
| 26 | |
| 27 | if not options.board: |
| 28 | parser.error('Need to specify --board') |
| 29 | |
| 30 | builder.UpdateGmergeBinhost(options.board, args[0], options.deep) |
| 31 | |
| 32 | |
| 33 | if __name__ == '__main__': |
| 34 | main() |