Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: build/android/gyp/push_libraries.py

Issue 2760923002: [build/android] Fix device.RunShellCommand usages (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 22 matching lines...) Expand all
33 33
34 serial_number = device.GetSerialNumber() 34 serial_number = device.GetSerialNumber()
35 # A list so that it is modifiable in Push below. 35 # A list so that it is modifiable in Push below.
36 needs_directory = [True] 36 needs_directory = [True]
37 for lib in libraries: 37 for lib in libraries:
38 device_path = os.path.join(options.device_dir, lib) 38 device_path = os.path.join(options.device_dir, lib)
39 host_path = os.path.join(options.libraries_dir, lib) 39 host_path = os.path.join(options.libraries_dir, lib)
40 40
41 def Push(): 41 def Push():
42 if needs_directory: 42 if needs_directory:
43 device.RunShellCommand('mkdir -p ' + options.device_dir) 43 device.RunShellCommand(
44 ['mkdir', '-p', options.device_dir], check_return=True)
44 needs_directory[:] = [] # = False 45 needs_directory[:] = [] # = False
45 device.PushChangedFiles([(os.path.abspath(host_path), device_path)]) 46 device.PushChangedFiles([(os.path.abspath(host_path), device_path)])
46 47
47 record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number) 48 record_path = '%s.%s.push.md5.stamp' % (host_path, serial_number)
48 md5_check.CallAndRecordIfStale( 49 md5_check.CallAndRecordIfStale(
49 Push, 50 Push,
50 record_path=record_path, 51 record_path=record_path,
51 input_paths=[host_path], 52 input_paths=[host_path],
52 input_strings=[device_path]) 53 input_strings=[device_path])
53 54
(...skipping 21 matching lines...) Expand all
75 output_directory=os.path.abspath(options.output_directory)) 76 output_directory=os.path.abspath(options.output_directory))
76 77
77 DoPush(options) 78 DoPush(options)
78 79
79 if options.stamp: 80 if options.stamp:
80 build_utils.Touch(options.stamp) 81 build_utils.Touch(options.stamp)
81 82
82 83
83 if __name__ == '__main__': 84 if __name__ == '__main__':
84 sys.exit(main(sys.argv[1:])) 85 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698