| 125 | run.command(['tar', '-C', path, '-xzf', file]) |
| 126 | |
| 127 | def extract_zip(file, path): |
| 128 | if sys.platform == 'darwin': |
| 129 | # We use the system unzip command for macOS because zip (and |
| 130 | # others) on macOS has special handling of ._ files that |
| 131 | # contain additional HFS+ attributes. See for example: |
| 132 | # http://superuser.com/questions/61185/why-do-i-get-files-like-foo-in-my-tarball-on-os-x |
| 133 | run.command(['unzip', file, '-d', path]) |
| 134 | else: |
| 135 | with zipfile.ZipFile(file, 'r') as zf: |
| 136 | zf.extractall(path) |
| 137 | |
| 138 | def extract(file, path): |
| 139 | log('Extracting %s to %s' % (file, path)) |