diff options
| -rw-r--r-- | CHANGES.txt | 5 | ||||
| -rw-r--r-- | distribute_setup.py | 23 |
2 files changed, 17 insertions, 11 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 866ba7d8..3aceb5ac 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -6,6 +6,11 @@ CHANGES 0.6.7 ----- +* Issue 64: use_setuptools no longer rebuilds the distribute egg every + time it is run +* use_setuptools now properly respects the requested version +* use_setuptools will no longer try to import a distribute egg for the + wrong Python version * Issue 74: no_fake should be True by default. * Issue 72: avoid a bootstrapping issue with easy_install -U diff --git a/distribute_setup.py b/distribute_setup.py index e7aafbb1..de7b1f6d 100644 --- a/distribute_setup.py +++ b/distribute_setup.py @@ -46,7 +46,7 @@ except ImportError: args = [quote(arg) for arg in args] return os.spawnl(os.P_WAIT, sys.executable, *args) == 0 -DEFAULT_VERSION = "0.6.7" +DEFAULT_VERSION = "0.6.6" DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/" SETUPTOOLS_PKG_INFO = """\ Metadata-Version: 1.0 @@ -84,7 +84,7 @@ def _install(tarball): os.chdir(old_wd) -def _build_egg(tarball, to_dir): +def _build_egg(egg, tarball, to_dir): # extracting the tarball tmpdir = tempfile.mkdtemp() log.warn('Extracting in %s', tmpdir) @@ -104,20 +104,21 @@ def _build_egg(tarball, to_dir): log.warn('Building a Distribute egg in %s', to_dir) _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir) - # returning the result - for file in os.listdir(to_dir): - if fnmatch.fnmatch(file, 'distribute-%s*.egg' % DEFAULT_VERSION): - return os.path.join(to_dir, file) - - raise IOError('Could not build the egg.') finally: os.chdir(old_wd) + # returning the result + log.warn(egg) + if not os.path.exists(egg): + raise IOError('Could not build the egg.') def _do_download(version, download_base, to_dir, download_delay): - tarball = download_setuptools(version, download_base, - to_dir, download_delay) - egg = _build_egg(tarball, to_dir) + egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg' + % (version, sys.version_info[0], sys.version_info[1])) + if not os.path.exists(egg): + tarball = download_setuptools(version, download_base, + to_dir, download_delay) + _build_egg(egg, tarball, to_dir) sys.path.insert(0, egg) import setuptools setuptools.bootstrap_install_from = egg |
