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 | |
Ryan Cui | 0af7a91 | 2012-06-19 01:00:47 | [diff] [blame] | 10 | import optparse |
Yu-Ju Hong | e2b3f74 | 2013-11-08 19:33:09 | [diff] [blame] | 11 | import sys |
Ryan Cui | 0af7a91 | 2012-06-19 01:00:47 | [diff] [blame] | 12 | |
Gilad Arnold | abb352e | 2012-09-23 08:24:27 | [diff] [blame] | 13 | import builder |
| 14 | |
Ryan Cui | 0af7a91 | 2012-06-19 01:00:47 | [diff] [blame] | 15 | |
| 16 | def 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 Hong | e2b3f74 | 2013-11-08 19:33:09 | [diff] [blame] | 32 | # Check if package was installed. |
| 33 | if not builder.UpdateGmergeBinhost(options.board, args[0], options.deep): |
| 34 | sys.exit(1) |
Ryan Cui | 0af7a91 | 2012-06-19 01:00:47 | [diff] [blame] | 35 | |
| 36 | |
| 37 | if __name__ == '__main__': |
| 38 | main() |