diff options
author | anatoly techtonik <techtonik@gmail.com> | 2015-02-03 23:21:08 +0300 |
---|---|---|
committer | anatoly techtonik <techtonik@gmail.com> | 2015-02-03 23:21:08 +0300 |
commit | fefef6e193c909e2ec52992f1a236adbc94b8c1d (patch) | |
tree | f37ed8daa788ce312f24ce1153592d136b619f4e /SConstruct | |
parent | fbea6cdb6fb41598a84c84778e70f96e925b96db (diff) | |
download | scons-fefef6e193c909e2ec52992f1a236adbc94b8c1d.tar.gz |
SConstruct: Compress SCons .zip archives
See
https://pairlist2.pair.net/pipermail/scons-dev/2015-January/002151.html
Diffstat (limited to 'SConstruct')
-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" |