Commit bfff594d authored by PJ Eby's avatar PJ Eby

Ignore bdist_dumb distributions when looking at download URLs

--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4045627
parent f471fd20
......@@ -96,7 +96,6 @@ def interpret_distro_name(location, basename, metadata,
``pkg_resources.normalize_path()`` on it before passing it to this
routine!
"""
# Generate alternative interpretations of a source distro name
# Because some packages are ambiguous as to name/versions split
# e.g. "adns-python-1.1.0", "egenix-mx-commercial", etc.
......@@ -110,6 +109,11 @@ def interpret_distro_name(location, basename, metadata,
# versions in distribution archive names (sdist and bdist).
parts = basename.split('-')
if not py_version:
for i,p in enumerate(parts[2:]):
if len(p)==5 and p.startswith('py2.'):
return # It's a bdist_dumb, not an sdist -- bail out
for p in range(1,len(parts)+1):
yield Distribution(
location, metadata, '-'.join(parts[:p]), '-'.join(parts[p:]),
......@@ -117,10 +121,6 @@ def interpret_distro_name(location, basename, metadata,
platform = platform
)
class PackageIndex(Environment):
"""A distribution index that scans web pages for download URLs"""
......@@ -534,6 +534,8 @@ class PackageIndex(Environment):
def retry_sf_download(self, url, filename):
try:
return self._download_to(url, filename)
except (KeyboardInterrupt,SystemExit):
raise
except:
scheme, server, path, param, query, frag = urlparse.urlparse(url)
if server!='dl.sourceforge.net':
......@@ -569,8 +571,6 @@ class PackageIndex(Environment):
def open_url(self, url):
try:
......
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