diff options
author | PJ Eby <distutils-sig@python.org> | 2006-02-13 21:35:50 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2006-02-13 21:35:50 +0000 |
commit | f4be07202e3e615ba7fc0e2256d236356cdc6902 (patch) | |
tree | 8146704ec5838bfef106bd631a4ce0c0129152fe /setuptools/command | |
parent | cef2b2986e6c3cfc7606c7f774c43f3189eb35ff (diff) | |
download | external_python_setuptools-f4be07202e3e615ba7fc0e2256d236356cdc6902.tar.gz external_python_setuptools-f4be07202e3e615ba7fc0e2256d236356cdc6902.tar.bz2 external_python_setuptools-f4be07202e3e615ba7fc0e2256d236356cdc6902.zip |
Don't compress eggs on Python 2.3, as a possible workaround for 64-bit
zipimport bug.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4042351
Diffstat (limited to 'setuptools/command')
-rw-r--r-- | setuptools/command/bdist_egg.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 4c0976d4..2a48362e 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -3,7 +3,7 @@ Build .egg distributions""" # This module should be kept compatible with Python 2.3 -import os, marshal +import sys, os, marshal from setuptools import Command from distutils.dir_util import remove_tree, mkpath from distutils.sysconfig import get_python_version, get_python_lib @@ -415,8 +415,7 @@ INSTALL_DIRECTORY_ATTRS = [ 'install_lib', 'install_dir', 'install_data', 'install_base' ] - -def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0): +def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0, compress=None): """Create a zip file from all the files under 'base_dir'. The output zip file will be named 'base_dir' + ".zip". Uses either the "zipfile" Python module (if available) or the InfoZIP "zip" utility (if installed @@ -425,7 +424,6 @@ def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0): """ import zipfile mkpath(os.path.dirname(zip_filename), dry_run=dry_run) - log.info("creating '%s' and adding '%s' to it", zip_filename, base_dir) def visit (z, dirname, names): @@ -437,9 +435,12 @@ def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0): z.write(path, p) log.debug("adding '%s'" % p) + if compress is None: + compress = (sys.version>="2.4") # avoid 2.3 zipimport bug when 64 bits + + compression = [zipfile.ZIP_STORED, zipfile.ZIP_DEFLATED][bool(compress)] if not dry_run: - z = zipfile.ZipFile(zip_filename, "w", - compression=zipfile.ZIP_DEFLATED) + z = zipfile.ZipFile(zip_filename, "w", compression=compression) os.path.walk(base_dir, visit, z) z.close() else: @@ -448,4 +449,3 @@ def make_zipfile (zip_filename, base_dir, verbose=0, dry_run=0): return zip_filename - |