Chromium Code Reviews| Index: scripts/common/chromium_utils.py |
| diff --git a/scripts/common/chromium_utils.py b/scripts/common/chromium_utils.py |
| index 89bee7a154060c32dca5725109bb8ff01f004618..459c7136c02ae6a5eeea126b016da0e4ea6a23d7 100644 |
| --- a/scripts/common/chromium_utils.py |
| +++ b/scripts/common/chromium_utils.py |
| @@ -600,7 +600,7 @@ def CopyFileToDir(src_path, dest_dir, dest_fn=None, link_ok=False): |
| def MakeZip(output_dir, archive_name, file_list, file_relative_dir, |
| - raise_error=True, remove_archive_directory=True): |
| + raise_error=True, remove_archive_directory=True, strip_files = []): |
|
dtu
2016/08/05 21:06:18
There's a tricky Python caveat with lists (or any
miimnk
2016/08/08 22:41:23
Done.
|
| """Packs files into a new zip archive. |
| Files are first copied into a directory within the output_dir named for |
| @@ -624,6 +624,8 @@ def MakeZip(output_dir, archive_name, file_list, file_relative_dir, |
| the list is not found. |
| remove_archive_directory: Whether to remove the archive staging directory |
| before copying files over to it. |
| + strip_files: List of executable files to strip symbols when zipping. The |
| + option currently does not work in Windows. |
| Returns: |
| A tuple consisting of (archive_dir, zip_file_path), where archive_dir |
| @@ -671,8 +673,14 @@ def MakeZip(output_dir, archive_name, file_list, file_relative_dir, |
| dest_dir = os.path.join(archive_dir, dirname) |
| MaybeMakeDirectory(dest_dir) |
| CopyFileToDir(src_path, dest_dir, basename, link_ok=True) |
| + if not IsWindows() and basename in strip_files: |
| + cmd = ['strip', os.path.join(dest_dir, basename)] |
| + RunCommand(cmd) |
| else: |
| CopyFileToDir(src_path, archive_dir, basename, link_ok=True) |
| + if not IsWindows() and basename in strip_files: |
| + cmd = ['strip', os.path.join(archive_dir, basename)] |
| + RunCommand(cmd) |
| except PathNotFound: |
| if raise_error: |
| raise |