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, ...@@ -96,7 +96,6 @@ def interpret_distro_name(location, basename, metadata,
``pkg_resources.normalize_path()`` on it before passing it to this ``pkg_resources.normalize_path()`` on it before passing it to this
routine! routine!
""" """
# Generate alternative interpretations of a source distro name # Generate alternative interpretations of a source distro name
# Because some packages are ambiguous as to name/versions split # Because some packages are ambiguous as to name/versions split
# e.g. "adns-python-1.1.0", "egenix-mx-commercial", etc. # e.g. "adns-python-1.1.0", "egenix-mx-commercial", etc.
...@@ -110,6 +109,11 @@ def interpret_distro_name(location, basename, metadata, ...@@ -110,6 +109,11 @@ def interpret_distro_name(location, basename, metadata,
# versions in distribution archive names (sdist and bdist). # versions in distribution archive names (sdist and bdist).
parts = basename.split('-') 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): for p in range(1,len(parts)+1):
yield Distribution( yield Distribution(
location, metadata, '-'.join(parts[:p]), '-'.join(parts[p:]), location, metadata, '-'.join(parts[:p]), '-'.join(parts[p:]),
...@@ -117,10 +121,6 @@ def interpret_distro_name(location, basename, metadata, ...@@ -117,10 +121,6 @@ def interpret_distro_name(location, basename, metadata,
platform = platform platform = platform
) )
class PackageIndex(Environment): class PackageIndex(Environment):
"""A distribution index that scans web pages for download URLs""" """A distribution index that scans web pages for download URLs"""
...@@ -534,6 +534,8 @@ class PackageIndex(Environment): ...@@ -534,6 +534,8 @@ class PackageIndex(Environment):
def retry_sf_download(self, url, filename): def retry_sf_download(self, url, filename):
try: try:
return self._download_to(url, filename) return self._download_to(url, filename)
except (KeyboardInterrupt,SystemExit):
raise
except: except:
scheme, server, path, param, query, frag = urlparse.urlparse(url) scheme, server, path, param, query, frag = urlparse.urlparse(url)
if server!='dl.sourceforge.net': if server!='dl.sourceforge.net':
...@@ -569,8 +571,6 @@ class PackageIndex(Environment): ...@@ -569,8 +571,6 @@ class PackageIndex(Environment):
def open_url(self, url): def open_url(self, url):
try: 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