From fefef6e193c909e2ec52992f1a236adbc94b8c1d Mon Sep 17 00:00:00 2001 From: anatoly techtonik Date: Tue, 3 Feb 2015 23:21:08 +0300 Subject: SConstruct: Compress SCons .zip archives See https://pairlist2.pair.net/pipermail/scons-dev/2015-January/002151.html --- SConstruct | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'SConstruct') diff --git a/SConstruct b/SConstruct index 27b07f21..c95c0a9b 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" -- cgit v1.2.1