Chromium Code Reviews| Index: native_client_sdk/src/tools/oshelpers.py |
| diff --git a/native_client_sdk/src/tools/oshelpers.py b/native_client_sdk/src/tools/oshelpers.py |
| index 041e9aa400867b088b22d4ada625e32fd3e57d3b..f40bee6662621ef200728ce2e6908d9759e0db32 100755 |
| --- a/native_client_sdk/src/tools/oshelpers.py |
| +++ b/native_client_sdk/src/tools/oshelpers.py |
| @@ -9,6 +9,7 @@ import optparse |
| import os |
| import posixpath |
| import shutil |
| +import stat |
| import sys |
| import time |
| import zipfile |
| @@ -425,7 +426,14 @@ def Zip(args): |
| zip_path = file_info_or_zip_path |
| if os_path: |
| - zip_stream.write(os_path, zip_path) |
| + if stat.S_ISDIR(os.stat(os_path).st_mode): |
| + # Python 2.6 on the buildbots doesn't support writing directories to |
| + # zip files. This was resolved in a later version of Python 2.6. |
| + # We'll work around it by writing an empty file with the correct |
| + # path. (This is basically what later versions do anyway.) |
| + zip_stream.writestr(zip_path, '') |
|
Sam Clegg
2012/11/30 19:01:43
Are you sure this is all it does? Surly there is
binji
2012/11/30 19:43:42
Doesn't seem to be. Though I am writing some of th
|
| + else: |
| + zip_stream.write(os_path, zip_path) |
| else: |
| zip_stream.writestr(file_info_or_zip_path, file_bytes) |