summaryrefslogtreecommitdiffstats
path: root/SConstruct
diff options
context:
space:
mode:
authoranatoly techtonik <techtonik@gmail.com>2015-02-03 20:21:08 (GMT)
committeranatoly techtonik <techtonik@gmail.com>2015-02-03 20:21:08 (GMT)
commitb2e68f654f456f13ad0ccefc3b09fe55475b1be1 (patch)
treef37ed8daa788ce312f24ce1153592d136b619f4e /SConstruct
parentb22e9980df40305bb8beac3ea03bb045e01a031c (diff)
downloadSCons-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
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct5
1 files changed, 3 insertions, 2 deletions
diff --git a/SConstruct b/SConstruct
index 27b07f2..c95c0a9 100644
--- a/SConstruct
+++ b/SConstruct
@@ -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"