summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2003-12-16 11:56:45 (GMT)
committerSteven Knight <knight@baldmt.com>2003-12-16 11:56:45 (GMT)
commit571141b46b2f9ee0f7150bdb3aeee11e2d7bcd21 (patch)
tree357c0b5f81ca33ee0f74c45dd581a9a424442b45 /src
parentcde0b273458b25194d63499f24abb877085eb47e (diff)
downloadSCons-571141b46b2f9ee0f7150bdb3aeee11e2d7bcd21.zip
SCons-571141b46b2f9ee0f7150bdb3aeee11e2d7bcd21.tar.gz
SCons-571141b46b2f9ee0f7150bdb3aeee11e2d7bcd21.tar.bz2
Have the Zip() Builder create compressed .zip files by default.
Diffstat (limited to 'src')
-rw-r--r--src/CHANGES.txt5
-rw-r--r--src/RELEASE.txt25
-rw-r--r--src/engine/SCons/Tool/zip.py18
3 files changed, 25 insertions, 23 deletions
diff --git a/src/CHANGES.txt b/src/CHANGES.txt
index bbeac15..1043b50 100644
--- a/src/CHANGES.txt
+++ b/src/CHANGES.txt
@@ -92,6 +92,11 @@ RELEASE 0.95 - XXX
- When scanning for libraries to link with, don't append $LIBPREFIXES
or $LIBSUFFIXES values to the $LIBS values if they're already present.
+ - Add a ZIPCOMPRESSION construction variable to control whether the
+ internal Python action for the Zip Builder compresses the file or
+ not. The default value is zipfile.ZIP_DEFLATED, which generates
+ a compressed file.
+
From Vincent Risi:
- Add support for the bcc32, ilink32 and tlib Borland tools.
diff --git a/src/RELEASE.txt b/src/RELEASE.txt
index 0651dca..4bb0a8f 100644
--- a/src/RELEASE.txt
+++ b/src/RELEASE.txt
@@ -20,26 +20,19 @@ more effectively, please sign up for the scons-users mailing list at:
-RELEASE 0.94 - Fri, 07 Nov 2003 05:29:48 -0600
+RELEASE 0.95 - XXX
- This is the fifth beta release of SCons. Please consult the
+ This is the sixth beta release of SCons. Please consult the
CHANGES.txt file for a list of specific changes since last release.
- Please note the following important changes since release 0.92:
+ Please note the following important changes since release 0.94:
- - Construction variables are now expanded anywhere within a
- target or source name, as well as in the arguments to the following
- Environment methods: AlwaysBuild(), Depends(), Ignore(), Install(),
- InstallAs(), Precious(), SideEffect() and SourceCode().
-
- If you have any files or directories that actually contain one or
- more dollar signs ($), you must now precede the dollar sign with
- another dollar sign ($$) when referring to the file or directory
- as part of calling a Builder, or any of the above methods.
-
- - The ParseConfig() global function has now been deprecated in favor
- of using the env.ParseConfig() method. The global function will be
- removed in some future release of SCons.
+ - The internal Python function used by the Zip Builder in Python
+ releases 1.6 or later now compresses the resulting .zip file
+ by default. The old behavior of creating an uncompressed file
+ may be preserved by setting the new ZIPCOMPRESSION construction
+ variable to 0 (or zipfile.ZIP_STORED, if you import the
+ underlying zipfile module).
SCons is developed with an extensive regression test suite, and a
rigorous development methodology for continually improving that suite.
diff --git a/src/engine/SCons/Tool/zip.py b/src/engine/SCons/Tool/zip.py
index 510aa6e..18f0caa 100644
--- a/src/engine/SCons/Tool/zip.py
+++ b/src/engine/SCons/Tool/zip.py
@@ -41,29 +41,32 @@ import SCons.Util
try:
import zipfile
+ internal_zip = 1
+except ImportError:
+ internal_zip = 0
+if internal_zip:
+ zipcompression = zipfile.ZIP_DEFLATED
def zip(target, source, env):
def visit(arg, dirname, names):
for name in names:
path = os.path.join(dirname, name)
if os.path.isfile(path):
arg.write(path)
- zf = zipfile.ZipFile(str(target[0]), 'w')
+ compression = env.get('ZIPCOMPRESSION', 0)
+ zf = zipfile.ZipFile(str(target[0]), 'w', compression)
for s in source:
if os.path.isdir(str(s)):
os.path.walk(str(s), visit, zf)
else:
zf.write(str(s))
zf.close()
-
- internal_zip = 1
-
-except ImportError:
+else:
+ zipcompression = 0
zip = "$ZIP $ZIPFLAGS ${TARGET.abspath} $SOURCES"
- internal_zip = 0
-zipAction = SCons.Action.Action(zip)
+zipAction = SCons.Action.Action(zip, varlist=['ZIPCOMPRESSION'])
ZipBuilder = SCons.Builder.Builder(action = '$ZIPCOM',
source_factory = SCons.Node.FS.default_fs.Entry,
@@ -82,6 +85,7 @@ def generate(env):
env['ZIP'] = 'zip'
env['ZIPFLAGS'] = ''
env['ZIPCOM'] = zipAction
+ env['ZIPCOMPRESSION'] = zipcompression
env['ZIPSUFFIX'] = '.zip'
def exists(env):