Commit dd45c0df authored by Tarek Ziade's avatar Tarek Ziade

using urlparse to extract the fragment

--HG--
branch : distribute
extra : rebase_source : a377df45aa49dd8eb33c52875b590401c5ddbef8
parent c68c5c96
...@@ -14,6 +14,7 @@ method. ...@@ -14,6 +14,7 @@ method.
""" """
import sys, os, zipimport, time, re, imp, types import sys, os, zipimport, time, re, imp, types
from urlparse import urlparse, urlunparse
try: try:
frozenset frozenset
...@@ -2044,8 +2045,13 @@ class EntryPoint(object): ...@@ -2044,8 +2045,13 @@ class EntryPoint(object):
parse_map = classmethod(parse_map) parse_map = classmethod(parse_map)
def _remove_md5_fragment(location):
if not location:
return ''
parsed = urlparse(location)
if 'md5' in parsed[-1]:
return urlunparse(parsed[:-1] + ('',))
return location
class Distribution(object): class Distribution(object):
...@@ -2079,12 +2085,13 @@ class Distribution(object): ...@@ -2079,12 +2085,13 @@ class Distribution(object):
) )
from_location = classmethod(from_location) from_location = classmethod(from_location)
hashcmp = property( hashcmp = property(
lambda self: ( lambda self: (
getattr(self,'parsed_version',()), getattr(self,'parsed_version',()),
self.precedence, self.precedence,
self.key, self.key,
(self.location or '').split('#md5=')[0], _remove_md5_fragment(self.location),
self.py_version, self.py_version,
self.platform self.platform
) )
......
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