Index: tools/bisect-builds.py |
diff --git a/tools/bisect-builds.py b/tools/bisect-builds.py |
index 6d0830f8d29752c2790c4e878f3376e941b5c7f7..a87807e4d826a4662c4c5894d94b6a22ec848e07 100755 |
--- a/tools/bisect-builds.py |
+++ b/tools/bisect-builds.py |
@@ -452,16 +452,32 @@ class PathContext(object): |
self.bad_revision) |
return revlist |
+ |
+def IsMac(): |
+ return sys.platform.startswith('darwin') |
+ |
+ |
def UnzipFilenameToDir(filename, directory): |
"""Unzip |filename| to |directory|.""" |
cwd = os.getcwd() |
if not os.path.isabs(filename): |
filename = os.path.join(cwd, filename) |
- zf = zipfile.ZipFile(filename) |
# Make base. |
if not os.path.isdir(directory): |
os.mkdir(directory) |
os.chdir(directory) |
+ |
+ # The Python ZipFile does not support symbolic links, which makes it |
+ # unsuitable for Mac builds. so use ditto instead. |
+ if IsMac(): |
+ unzip_cmd = ['ditto', '-x', '-k', filename, '.'] |
+ proc = subprocess.Popen(unzip_cmd, bufsize=0, stdout=subprocess.PIPE, |
+ stderr=subprocess.PIPE) |
+ proc.communicate() |
+ os.chdir(cwd) |
+ return |
+ |
+ zf = zipfile.ZipFile(filename) |
# Extract files. |
for info in zf.infolist(): |
name = info.filename |