Commit b1bd773f authored by Daniel Stutzbach's avatar Daniel Stutzbach

Fixed build_egg to test for the existence of the correct egg filename.

--HG--
branch : distribute
extra : rebase_source : c944237f4b1aff19e3f6838b83945b7e4bff48de
parent 032f6e80
...@@ -84,7 +84,7 @@ def _install(tarball): ...@@ -84,7 +84,7 @@ def _install(tarball):
os.chdir(old_wd) os.chdir(old_wd)
def _build_egg(tarball, to_dir): def _build_egg(egg, tarball, to_dir):
# extracting the tarball # extracting the tarball
tmpdir = tempfile.mkdtemp() tmpdir = tempfile.mkdtemp()
log.warn('Extracting in %s', tmpdir) log.warn('Extracting in %s', tmpdir)
...@@ -105,10 +105,7 @@ def _build_egg(tarball, to_dir): ...@@ -105,10 +105,7 @@ def _build_egg(tarball, to_dir):
_python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir) _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
# returning the result # returning the result
for file in os.listdir(to_dir): if not os.path.exists(egg):
if fnmatch.fnmatch(file, 'distribute-%s*.egg' % DEFAULT_VERSION):
return os.path.join(to_dir, file)
raise IOError('Could not build the egg.') raise IOError('Could not build the egg.')
finally: finally:
os.chdir(old_wd) os.chdir(old_wd)
...@@ -120,7 +117,7 @@ def _do_download(version, download_base, to_dir, download_delay): ...@@ -120,7 +117,7 @@ def _do_download(version, download_base, to_dir, download_delay):
if not os.path.exists(egg): if not os.path.exists(egg):
tarball = download_setuptools(version, download_base, tarball = download_setuptools(version, download_base,
to_dir, download_delay) to_dir, download_delay)
egg = _build_egg(tarball, to_dir) _build_egg(egg, tarball, to_dir)
sys.path.insert(0, egg) sys.path.insert(0, egg)
import setuptools import setuptools
setuptools.bootstrap_install_from = egg setuptools.bootstrap_install_from = egg
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment