| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Creates a zip archive for the Chrome Remote Desktop Host installer. | 6 """Creates a zip archive for the Chrome Remote Desktop Host installer. |
| 7 | 7 |
| 8 This script builds a zip file that contains all the files needed to build an | 8 This script builds a zip file that contains all the files needed to build an |
| 9 installer for Chrome Remote Desktop Host. | 9 installer for Chrome Remote Desktop Host. |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 defs: Dictionary of variable definitions. | 83 defs: Dictionary of variable definitions. |
| 84 """ | 84 """ |
| 85 root_len = len(files_root) | 85 root_len = len(files_root) |
| 86 local_file_path = dst_file[root_len:] | 86 local_file_path = dst_file[root_len:] |
| 87 full_dst_file = os.path.join(out_dir, local_file_path) | 87 full_dst_file = os.path.join(out_dir, local_file_path) |
| 88 dst_dir = os.path.dirname(full_dst_file) | 88 dst_dir = os.path.dirname(full_dst_file) |
| 89 if not os.path.exists(dst_dir): | 89 if not os.path.exists(dst_dir): |
| 90 os.makedirs(dst_dir, 0775) | 90 os.makedirs(dst_dir, 0775) |
| 91 | 91 |
| 92 (base, ext) = os.path.splitext(src_file) | 92 (base, ext) = os.path.splitext(src_file) |
| 93 if ext == '.app': | 93 if ext in ['.app', '.prefPane']: |
| 94 shutil.copytree(src_file, full_dst_file) | 94 shutil.copytree(src_file, full_dst_file) |
| 95 elif ext in ['.sh', '.packproj', '.plist']: | 95 elif ext in ['.sh', '.packproj', '.plist']: |
| 96 copyFileWithDefs(src_file, full_dst_file, defs) | 96 copyFileWithDefs(src_file, full_dst_file, defs) |
| 97 else: | 97 else: |
| 98 shutil.copy2(src_file, full_dst_file) | 98 shutil.copy2(src_file, full_dst_file) |
| 99 | 99 |
| 100 | 100 |
| 101 def copyFileWithDefs(src_file, dst_file, defs): | 101 def copyFileWithDefs(src_file, dst_file, defs): |
| 102 """Copies from src_file to dst_file, performing variable substitution. | 102 """Copies from src_file to dst_file, performing variable substitution. |
| 103 | 103 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 | 246 |
| 247 result = buildHostArchive(temp_dir, zip_path, source_files_root, | 247 result = buildHostArchive(temp_dir, zip_path, source_files_root, |
| 248 source_files, generated_files, generated_files_dst, | 248 source_files, generated_files, generated_files_dst, |
| 249 defs) | 249 defs) |
| 250 | 250 |
| 251 return 0 | 251 return 0 |
| 252 | 252 |
| 253 | 253 |
| 254 if __name__ == '__main__': | 254 if __name__ == '__main__': |
| 255 sys.exit(main()) | 255 sys.exit(main()) |
| OLD | NEW |