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

Unified Diff: tools/bisect-perf-regression.py

Issue 306023008: Use python fallback for unzipping in extracting build on mac if file is greater than 4GB (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bisect-perf-regression.py
diff --git a/tools/bisect-perf-regression.py b/tools/bisect-perf-regression.py
index 674a782df220fea7853c60c400420abcacd398f6..721ca55696eba444030107327bdf843126aaafa0 100755
--- a/tools/bisect-perf-regression.py
+++ b/tools/bisect-perf-regression.py
@@ -522,10 +522,15 @@ def ExtractZip(filename, output_dir, verbose=True):
# handle links and file bits (executable), which is much
# easier then trying to do that with ZipInfo options.
#
+ # The Mac Version of unzip unfortunately does not support Zip64, whereas
+ # the python module does, so we have to fallback to the python zip module
+ # on Mac if the filesize is greater than 4GB.
+ #
# On Windows, try to use 7z if it is installed, otherwise fall back to python
# zip module and pray we don't have files larger than 512MB to unzip.
unzip_cmd = None
- if IsMac() or IsLinux():
+ if ((IsMac() and os.path.getsize(filename) < 4 * 1024 * 1024 * 1024)
+ or IsLinux()):
unzip_cmd = ['unzip', '-o']
elif IsWindows() and os.path.exists('C:\\Program Files\\7-Zip\\7z.exe'):
unzip_cmd = ['C:\\Program Files\\7-Zip\\7z.exe', 'x', '-y']
@@ -541,12 +546,16 @@ def ExtractZip(filename, output_dir, verbose=True):
if result:
raise IOError('unzip failed: %s => %s' % (str(command), result))
else:
- assert IsWindows()
+ assert IsWindows() or IsMac()
zf = zipfile.ZipFile(filename)
for name in zf.namelist():
if verbose:
print 'Extracting %s' % name
zf.extract(name, output_dir)
+ if IsMac():
+ # Restore permission bits.
+ os.chmod(os.path.join(output_dir, name),
+ zf.getinfo(name).external_attr >> 16L)
def RunProcess(command):
« 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