| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright 2013 The Chromium Authors. All rights reserved. | 3 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 """Pushes native libraries to a device. | 7 """Pushes native libraries to a device. |
| 8 | 8 |
| 9 """ | 9 """ |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number) | 42 record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number) |
| 43 md5_check.CallAndRecordIfStale( | 43 md5_check.CallAndRecordIfStale( |
| 44 Push, | 44 Push, |
| 45 record_path=record_path, | 45 record_path=record_path, |
| 46 input_paths=[host_path], | 46 input_paths=[host_path], |
| 47 input_strings=[device_path]) | 47 input_strings=[device_path]) |
| 48 | 48 |
| 49 | 49 |
| 50 def main(argv): | 50 def main(argv): |
| 51 if not build_utils.IsDeviceReady(): |
| 52 build_utils.PrintBigWarning( |
| 53 'Zero (or multiple) devices attached. Skipping native library push.') |
| 54 return |
| 55 |
| 51 parser = optparse.OptionParser() | 56 parser = optparse.OptionParser() |
| 52 parser.add_option('--libraries-dir', | 57 parser.add_option('--libraries-dir', |
| 53 help='Directory that contains stripped libraries.') | 58 help='Directory that contains stripped libraries.') |
| 54 parser.add_option('--device-dir', | 59 parser.add_option('--device-dir', |
| 55 help='Device directory to push the libraries to.') | 60 help='Device directory to push the libraries to.') |
| 56 parser.add_option('--libraries-json', | 61 parser.add_option('--libraries-json', |
| 57 help='Path to the json list of native libraries.') | 62 help='Path to the json list of native libraries.') |
| 58 parser.add_option('--stamp', help='Path to touch on success.') | 63 parser.add_option('--stamp', help='Path to touch on success.') |
| 59 options, _ = parser.parse_args() | 64 options, _ = parser.parse_args() |
| 60 | 65 |
| 61 required_options = ['libraries_dir', 'device_dir', 'libraries_json'] | 66 required_options = ['libraries_dir', 'device_dir', 'libraries_json'] |
| 62 build_utils.CheckOptions(options, parser, required=required_options) | 67 build_utils.CheckOptions(options, parser, required=required_options) |
| 63 | 68 |
| 64 DoPush(options) | 69 DoPush(options) |
| 65 | 70 |
| 66 if options.stamp: | 71 if options.stamp: |
| 67 build_utils.Touch(options.stamp) | 72 build_utils.Touch(options.stamp) |
| 68 | 73 |
| 69 | 74 |
| 70 if __name__ == '__main__': | 75 if __name__ == '__main__': |
| 71 sys.exit(main(sys.argv)) | 76 sys.exit(main(sys.argv)) |
| OLD | NEW |