From d795ab891c157bcda542f9cab5375805a19af7b0 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Fri, 27 Jul 2018 19:23:25 +0000 Subject: [PATCH] Use system unzip on macOS Modern macOS has no problem unzipping big zip files. To test: $ gsutil cp gs://chromium-git-cache/chromium.googlesource.com-chromium-src/516491.zip test.zip $ unzip -l test.zip Change-Id: I84b3cff21cb9b7033c04b427e23f27a75ab1d8ae Reviewed-on: https://chromium-review.googlesource.com/1152294 Commit-Queue: Jeremy Apthorp Reviewed-by: Robbie Iannucci --- git_cache.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/git_cache.py b/git_cache.py index 6554da8d7..0dc40e38c 100755 --- a/git_cache.py +++ b/git_cache.py @@ -357,15 +357,12 @@ class Mirror(object): """ if not self.bootstrap_bucket: return False - python_fallback = False - if (sys.platform.startswith('win') and - not gclient_utils.FindExecutable('7z')): - python_fallback = True - elif sys.platform.startswith('darwin'): - # The OSX version of unzip doesn't support zip64. - python_fallback = True - elif not gclient_utils.FindExecutable('unzip'): - python_fallback = True + python_fallback = ( + (sys.platform.startswith('win') and + not gclient_utils.FindExecutable('7z')) or + (not gclient_utils.FindExecutable('unzip')) or + ('ZIP64_SUPPORT' not in subprocess.check_output(["unzip", "-v"])) + ) gs_folder = 'gs://%s/%s' % (self.bootstrap_bucket, self.basedir) gsutil = Gsutil(self.gsutil_exe, boto_path=None)