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

Unified Diff: scripts/common/chromium_utils.py

Issue 2128613005: Archive Linux perf builds for manual bisect (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/build.git@master
Patch Set: added a missing comma Created 4 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/archive/api.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/common/chromium_utils.py
diff --git a/scripts/common/chromium_utils.py b/scripts/common/chromium_utils.py
index 9cec00aa16b323a936045db4a98aa60f8bd0b93b..b98b7c6710b869a175b666cf9587674414512f66 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=None):
"""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
@@ -633,7 +635,8 @@ def MakeZip(output_dir, archive_name, file_list, file_relative_dir,
PathNotFound if any of the files in the list is not found, unless
raise_error is False, in which case the error will be ignored.
"""
-
+ if not strip_files:
+ strip_files = []
start_time = time.clock()
# Collect files into the archive directory.
archive_dir = os.path.join(output_dir, archive_name)
@@ -671,8 +674,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
« no previous file with comments | « no previous file | scripts/slave/recipe_modules/archive/api.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698