Commit 4134e533 authored by jim's avatar jim

61890: file:// urls don't seem to work in find-links

setuptools requires that file urls that point to directories must
end in a "/".  Added a workaround.


git-svn-id: http://svn.zope.org/repos/main/zc.buildout/trunk@75706 62d5b8a3-27da-0310-9561-8e5933582275
parent 5f786b1f
......@@ -25,6 +25,11 @@ Bugs Fixed
- 59270: Buggy recipes can cause failures in later recipes via chdir
- 61890: file:// urls don't seem to work in find-links
setuptools requires that file urls that point to directories must
end in a "/". Added a workaround.
1.0.0b24 (2007-05-09)
=====================
......
......@@ -134,8 +134,10 @@ class Installer:
" download cache")
links = ()
index = 'file://' + self._download_cache
self._links = links = list(links)
self._links = links = list(_fix_file_links(links))
if self._download_cache and (self._download_cache not in links):
links.insert(0, self._download_cache)
......@@ -973,3 +975,11 @@ def _needed(ws, needed_dist, write, seen):
seen.append(dist)
_needed(ws, dist, write, seen)
seen.pop()
def _fix_file_links(links):
for link in links:
if link.startswith('file://') and link[-1] != '/':
if os.path.isdir(link[7:]):
# work around excessive restriction in setuptools:
link += '/'
yield link
......@@ -2036,6 +2036,30 @@ def bug_59270_recipes_always_start_in_buildout_dir():
"""
def bug_61890_file_urls_dont_seem_to_work_in_find_dash_links():
"""
This bug arises from the fact that setuptools is over restrictive
about file urls, requiring that file urls pointing at directories
must end in a slash.
>>> dest = tmpdir('sample-install')
>>> import zc.buildout.easy_install
>>> ws = zc.buildout.easy_install.install(
... ['demo==0.2'], dest,
... links=['file://'+sample_eggs], index=link_server+'index/')
>>> for dist in ws:
... print dist
demo 0.2
demoneeded 1.1
>>> ls(dest)
- demo-0.2-py2.4.egg
- demoneeded-1.1-py2.4.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