diff options
| author | Christophe Combelles <ccomb@free.fr> | 2010-05-19 23:11:22 +0200 |
|---|---|---|
| committer | Christophe Combelles <ccomb@free.fr> | 2010-05-19 23:11:22 +0200 |
| commit | f3411291c4ec89df2f9fe18263a5509fb4caaddf (patch) | |
| tree | d2ca36905b32d6ab726c01a68db040dcab6d13e5 /setuptools | |
| parent | 29ffeae7d36c6e6c2a10dd230f8472226f51d955 (diff) | |
| download | python-setuptools-git-f3411291c4ec89df2f9fe18263a5509fb4caaddf.tar.gz | |
fixed issue 163 : don't include md5 when comparing two distributions, and scan
index links before external page links.
--HG--
branch : distribute
extra : rebase_source : d190057280e7cb27317eb4aa40e75f1c851ed6e5
Diffstat (limited to 'setuptools')
4 files changed, 7 insertions, 9 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py index 1c50d86f..ba43cfbf 100755 --- a/setuptools/package_index.py +++ b/setuptools/package_index.py @@ -203,11 +203,11 @@ class PackageIndex(Environment): charset = f.headers.get_param('charset') or 'latin-1' page = page.decode(charset, "ignore") f.close() - if url.startswith(self.index_url) and getattr(f,'code',None)!=404: - page = self.process_index(url, page) for match in HREF.finditer(page): link = urlparse.urljoin(base, htmldecode(match.group(1))) self.process_url(link) + if url.startswith(self.index_url) and getattr(f,'code',None)!=404: + page = self.process_index(url, page) def process_filename(self, fn, nested=False): # process filenames or directories diff --git a/setuptools/tests/indexes/test_links_priority/external.html b/setuptools/tests/indexes/test_links_priority/external.html index 883e9790..92e4702f 100644 --- a/setuptools/tests/indexes/test_links_priority/external.html +++ b/setuptools/tests/indexes/test_links_priority/external.html @@ -1,3 +1,3 @@ <html><body> -<a href="foobar-0.1.tar.gz#md5=bad_md5">bad old link</a> +<a href="/foobar-0.1.tar.gz#md5=1__bad_md5___">bad old link</a> </body></html> diff --git a/setuptools/tests/indexes/test_links_priority/simple/foobar/index.html b/setuptools/tests/indexes/test_links_priority/simple/foobar/index.html index dc6273d1..fefb028b 100644 --- a/setuptools/tests/indexes/test_links_priority/simple/foobar/index.html +++ b/setuptools/tests/indexes/test_links_priority/simple/foobar/index.html @@ -1,4 +1,4 @@ <html><body> -<a href="foobar-0.1.tar.gz#md5=correct_md5">foobar-0.1.tar.gz</a><br/> +<a href="/foobar-0.1.tar.gz#md5=0_correct_md5">foobar-0.1.tar.gz</a><br/> <a href="../../external.html" rel="homepage">external homepage</a><br/> </body></html> diff --git a/setuptools/tests/test_packageindex.py b/setuptools/tests/test_packageindex.py index 5c1c6970..42cb8c1e 100644 --- a/setuptools/tests/test_packageindex.py +++ b/setuptools/tests/test_packageindex.py @@ -103,12 +103,10 @@ class TestPackageIndex(unittest.TestCase): # the distribution has been found self.assert_('foobar' in pi) - # we have two links - self.assert_(len(pi['foobar'])==2) - # the first link should be from the index + # we have only one link, because links are compared without md5 + self.assert_(len(pi['foobar'])==1) + # the link should be from the index self.assert_('correct_md5' in pi['foobar'][0].location) - # the second link should be the external one - self.assert_('bad_md5' in pi['foobar'][1].location) |
