Commit f471fd20 authored by PJ Eby's avatar PJ Eby

Backport support for file:// directory URLs in --find-links to 0.6

branch.

--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4045556
parent fe16ffbe
......@@ -179,7 +179,7 @@ class PackageIndex(Environment):
def process_filename(self, fn, nested=False):
# process filenames or directories
if not os.path.exists(fn):
self.warn("Not found: %s", url)
self.warn("Not found: %s", fn)
return
if os.path.isdir(fn) and not nested:
......@@ -450,7 +450,7 @@ class PackageIndex(Environment):
def gen_setup(self, filename, fragment, tmpdir):
match = EGG_FRAGMENT.match(fragment); #import pdb; pdb.set_trace()
match = EGG_FRAGMENT.match(fragment)
dists = match and [d for d in
interpret_distro_name(filename, match.group(1), None) if d.version
] or []
......@@ -582,7 +582,6 @@ class PackageIndex(Environment):
def _download_url(self, scheme, url, tmpdir):
# Determine download filename
#
name = filter(None,urlparse.urlparse(url)[2].split('/'))
......@@ -602,6 +601,8 @@ class PackageIndex(Environment):
#
if scheme=='svn' or scheme.startswith('svn+'):
return self._download_svn(url, filename)
elif scheme=='file':
return urllib2.url2pathname(urlparse.urlparse(url)[2])
else:
headers = self.retry_sf_download(url, filename)
if 'html' in headers['content-type'].lower():
......@@ -612,7 +613,6 @@ class PackageIndex(Environment):
def scan_url(self, url):
self.process_url(url, True)
def _download_html(self, url, headers, filename, tmpdir):
file = open(filename)
for line in file:
......@@ -694,4 +694,4 @@ def get_sf_ip():
# this line is a kludge to keep the trailing blank lines for pje's editor
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