OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 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 glob | 6 import glob |
7 import hashlib | 7 import hashlib |
8 import os | 8 import os |
9 import shutil | 9 import shutil |
10 import sys | 10 import sys |
11 | 11 |
12 script_dir = os.path.dirname(os.path.realpath(__file__)) | 12 script_dir = os.path.dirname(os.path.realpath(__file__)) |
13 src_build_dir = os.path.abspath(os.path.join(script_dir, os.pardir)) | 13 src_build_dir = os.path.abspath(os.path.join(script_dir, os.pardir, os.pardir)) |
14 sys.path.insert(0, src_build_dir) | 14 sys.path.insert(0, src_build_dir) |
15 | 15 |
16 import vs_toolchain | 16 import vs_toolchain |
17 | 17 |
18 | 18 |
19 def _HexDigest(file_name): | 19 def _HexDigest(file_name): |
20 hasher = hashlib.sha256() | 20 hasher = hashlib.sha256() |
21 afile = open(file_name, 'rb') | 21 afile = open(file_name, 'rb') |
22 blocksize = 65536 | 22 blocksize = 65536 |
23 buf = afile.read(blocksize) | 23 buf = afile.read(blocksize) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 def main(): | 100 def main(): |
101 if len(sys.argv) < 2: | 101 if len(sys.argv) < 2: |
102 print >>sys.stderr, 'Usage: copy_cdb_to_output.py <output_dir> ' + \ | 102 print >>sys.stderr, 'Usage: copy_cdb_to_output.py <output_dir> ' + \ |
103 '<target_arch>' | 103 '<target_arch>' |
104 return 1 | 104 return 1 |
105 return _CopyCDBToOutput(sys.argv[1], sys.argv[2]) | 105 return _CopyCDBToOutput(sys.argv[1], sys.argv[2]) |
106 | 106 |
107 | 107 |
108 if __name__ == '__main__': | 108 if __name__ == '__main__': |
109 sys.exit(main()) | 109 sys.exit(main()) |
OLD | NEW |