Use unzip command on Mac to keep symbol links in zip file work.

This commit is contained in:
Cheng Zhao 2013-06-21 10:32:57 +08:00
Родитель 2f50102b50
Коммит 1eb521d32a
1 изменённых файлов: 8 добавлений и 2 удалений

Просмотреть файл

@ -3,6 +3,8 @@
import atexit
import errno
import shutil
import subprocess
import sys
import tarfile
import tempfile
import urllib2
@ -44,8 +46,12 @@ def extract_tarball(tarball_path, member, destination):
def extract_zip(zip_path, destination):
with zipfile.ZipFile(zip_path) as z:
z.extractall(destination)
if sys.platform == 'darwin':
# Use unzip command on Mac to keep symbol links in zip file work.
subprocess.check_call(['unzip', zip_path, '-d', destination])
else:
with zipfile.ZipFile(zip_path) as z:
z.extractall(destination)
def safe_unlink(path):