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

Side by Side Diff: sky/tools/android_library_cacher.py

Issue 1158493005: Cache .so files for debugging per device and don't redownload .so's that are in your cache (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import argparse 6 import argparse
7 import logging 7 import logging
8 import os 8 import os
9 import re 9 import re
10 import skypy.paths 10 import skypy.paths
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 dev_null = open(os.devnull, 'w') # Leaking. 51 dev_null = open(os.devnull, 'w') # Leaking.
52 to_pull = set(filter(None, map(library_from_line, maps_lines))) 52 to_pull = set(filter(None, map(library_from_line, maps_lines)))
53 to_pull.add('/system/bin/linker') # Unclear why but adb_gdb pulls this too. 53 to_pull.add('/system/bin/linker') # Unclear why but adb_gdb pulls this too.
54 for library_path in sorted(to_pull): 54 for library_path in sorted(to_pull):
55 # Not using os.path.join since library_path is absolute. 55 # Not using os.path.join since library_path is absolute.
56 dest_file = os.path.normpath("%s/%s" % (args.cache_root, library_path)) 56 dest_file = os.path.normpath("%s/%s" % (args.cache_root, library_path))
57 dest_dir = os.path.dirname(dest_file) 57 dest_dir = os.path.dirname(dest_file)
58 if not os.path.exists(dest_dir): 58 if not os.path.exists(dest_dir):
59 os.makedirs(dest_dir) 59 os.makedirs(dest_dir)
60 if os.path.exists(dest_file):
61 continue
60 print '%s -> %s' % (library_path, dest_file) 62 print '%s -> %s' % (library_path, dest_file)
61 pull_cmd = [ADB_PATH, 'pull', library_path, dest_file] 63 pull_cmd = [ADB_PATH, 'pull', library_path, dest_file]
62 subprocess.check_call(pull_cmd, stderr=dev_null) 64 subprocess.check_call(pull_cmd, stderr=dev_null)
63 65
64 66
65 if __name__ == '__main__': 67 if __name__ == '__main__':
66 main() 68 main()
OLDNEW
« no previous file with comments | « no previous file | sky/tools/skydb » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698