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

Side by Side Diff: scripts/slave/recipe_modules/isolate/resources/remove_build_metadata.py

Issue 2122233003: Revert of Search in apks/ as well as *_apk/ for built apks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: Created 4 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 """Remove the build metadata embedded in the artifacts of a build.""" 5 """Remove the build metadata embedded in the artifacts of a build."""
6 6
7 import json 7 import json
8 import multiprocessing 8 import multiprocessing
9 import optparse 9 import optparse
10 import os 10 import os
(...skipping 22 matching lines...) Expand all
33 if not os.path.isfile(f) or os.path.basename(f).startswith('.'): 33 if not os.path.isfile(f) or os.path.basename(f).startswith('.'):
34 return False 34 return False
35 if os.path.getmtime(os.path.join(build_dir, f)) < min_timestamp: 35 if os.path.getmtime(os.path.join(build_dir, f)) < min_timestamp:
36 return False 36 return False
37 ext = os.path.splitext(f)[1] 37 ext = os.path.splitext(f)[1]
38 return (ext in non_x_ok_exts) or (ext in allowed and os.access(f, os.X_OK)) 38 return (ext in non_x_ok_exts) or (ext in allowed and os.access(f, os.X_OK))
39 39
40 ret_files = set() 40 ret_files = set()
41 for root, dirs, files in os.walk(build_dir): 41 for root, dirs, files in os.walk(build_dir):
42 if not recursive: 42 if not recursive:
43 dirs[:] = [d for d in dirs 43 dirs[:] = [d for d in dirs if d.endswith('_apk')]
44 if d.endswith('_apk') or d == 'apks']
45 for f in (f for f in files if check(os.path.join(root, f))): 44 for f in (f for f in files if check(os.path.join(root, f))):
46 ret_files.add(os.path.relpath(os.path.join(root, f), build_dir)) 45 ret_files.add(os.path.relpath(os.path.join(root, f), build_dir))
47 return ret_files 46 return ret_files
48 47
49 48
50 def run_zap_timestamp(src_dir, filepath): 49 def run_zap_timestamp(src_dir, filepath):
51 """Run zap_timestamp.exe on a PE binary.""" 50 """Run zap_timestamp.exe on a PE binary."""
52 assert sys.platform == 'win32' 51 assert sys.platform == 'win32'
53 syzygy_dir = os.path.join( 52 syzygy_dir = os.path.join(
54 src_dir, 'third_party', 'syzygy', 'binaries', 'exe') 53 src_dir, 'third_party', 'syzygy', 'binaries', 'exe')
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 parser.error('--build-dir is required') 150 parser.error('--build-dir is required')
152 151
153 if sys.platform == 'win32' and not options.src_dir: 152 if sys.platform == 'win32' and not options.src_dir:
154 parser.error('--src-dir is required') 153 parser.error('--src-dir is required')
155 154
156 return remove_metadata(options.build_dir, options.src_dir, options.recursive) 155 return remove_metadata(options.build_dir, options.src_dir, options.recursive)
157 156
158 157
159 if __name__ == '__main__': 158 if __name__ == '__main__':
160 sys.exit(main()) 159 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698