diff options
author | anatoly techtonik <techtonik@gmail.com> | 2015-02-03 20:21:08 (GMT) |
---|---|---|
committer | anatoly techtonik <techtonik@gmail.com> | 2015-02-03 20:21:08 (GMT) |
commit | b2e68f654f456f13ad0ccefc3b09fe55475b1be1 (patch) | |
tree | f37ed8daa788ce312f24ce1153592d136b619f4e | |
parent | b22e9980df40305bb8beac3ea03bb045e01a031c (diff) | |
download | SCons-b2e68f654f456f13ad0ccefc3b09fe55475b1be1.zip SCons-b2e68f654f456f13ad0ccefc3b09fe55475b1be1.tar.gz SCons-b2e68f654f456f13ad0ccefc3b09fe55475b1be1.tar.bz2 |
SConstruct: Compress SCons .zip archives
See
https://pairlist2.pair.net/pipermail/scons-dev/2015-January/002151.html
-rw-r--r-- | SConstruct | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -331,7 +331,8 @@ try: path = os.path.join(dirname, name) if os.path.isfile(path): arg.write(path) - zf = zipfile.ZipFile(str(target[0]), 'w') + # default ZipFile compression is ZIP_STORED + zf = zipfile.ZipFile(str(target[0]), 'w', compression=zipfile.ZIP_DEFLATED) olddir = os.getcwd() os.chdir(env['CD']) try: os.path.walk(env['PSV'], visit, zf) @@ -356,7 +357,7 @@ try: if not os.path.isdir(dest): open(dest, 'wb').write(zf.read(name)) -except: +except ImportError: if unzip and zip: zipit = "cd $CD && $ZIP $ZIPFLAGS $( ${TARGET.abspath} $) $PSV" unzipit = "$UNZIP $UNZIPFLAGS $SOURCES" |