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 17 matching lines...) Expand all Loading... |
28 adb = android_commands.AndroidCommands() | 28 adb = android_commands.AndroidCommands() |
29 serial_number = adb.Adb().GetSerialNumber() | 29 serial_number = adb.Adb().GetSerialNumber() |
30 # A list so that it is modifiable in Push below. | 30 # A list so that it is modifiable in Push below. |
31 needs_directory = [True] | 31 needs_directory = [True] |
32 for lib in libraries: | 32 for lib in libraries: |
33 device_path = os.path.join(options.device_dir, lib) | 33 device_path = os.path.join(options.device_dir, lib) |
34 host_path = os.path.join(options.libraries_dir, lib) | 34 host_path = os.path.join(options.libraries_dir, lib) |
35 | 35 |
36 def Push(): | 36 def Push(): |
37 if needs_directory: | 37 if needs_directory: |
38 adb.RunShellCommand('mkdir ' + options.device_dir) | 38 adb.RunShellCommand('mkdir -p ' + options.device_dir) |
39 needs_directory[:] = [] # = False | 39 needs_directory[:] = [] # = False |
40 adb.PushIfNeeded(host_path, device_path) | 40 adb.PushIfNeeded(host_path, device_path) |
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 |
(...skipping 18 matching lines...) Expand all Loading... |
67 build_utils.CheckOptions(options, parser, required=required_options) | 67 build_utils.CheckOptions(options, parser, required=required_options) |
68 | 68 |
69 DoPush(options) | 69 DoPush(options) |
70 | 70 |
71 if options.stamp: | 71 if options.stamp: |
72 build_utils.Touch(options.stamp) | 72 build_utils.Touch(options.stamp) |
73 | 73 |
74 | 74 |
75 if __name__ == '__main__': | 75 if __name__ == '__main__': |
76 sys.exit(main(sys.argv)) | 76 sys.exit(main(sys.argv)) |
OLD | NEW |