Browse files

Use a glob pattern for discovering the distribute and setuptools file…

… name.
  • Loading branch information...
1 parent 756fd95 commit c02e1d1862f098ec39299ed70b26d9ae3e299130 @jezdez jezdez committed Sep 3, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 virtualenv.py
View
10 virtualenv.py
@@ -18,6 +18,7 @@
import tempfile
import zlib
import errno
+import glob
import distutils.sysconfig
from distutils.util import strtobool
import struct
@@ -472,8 +473,9 @@ def make_exe(fn):
def _find_file(filename, dirs):
for dir in reversed(dirs):
- if os.path.exists(join(dir, filename)):
- return join(dir, filename)
+ files = glob.glob(os.path.join(dir, filename))
+ if files and os.path.exists(files[0]):
+ return files[0]
return filename
def _install_req(py_executable, unzip=False, distribute=False,
@@ -483,13 +485,13 @@ def _install_req(py_executable, unzip=False, distribute=False,
search_dirs = file_search_dirs()
if not distribute:
- setup_fn = 'setuptools-0.6c11-py%s.egg' % sys.version[:3]
+ setup_fn = 'setuptools-*-py%s.egg' % sys.version[:3]
project_name = 'setuptools'
bootstrap_script = EZ_SETUP_PY
source = None
else:
setup_fn = None
- source = 'distribute-0.6.28.tar.gz'
+ source = 'distribute-*.tar.gz'
project_name = 'distribute'
bootstrap_script = DISTRIBUTE_SETUP_PY

0 comments on commit c02e1d1

Please sign in to comment.