提交 7b747a98 编写于 作者: I Ian Bicking

[svn r21848] Fix -f (search those for links) and detect zip files better

上级 0d58e2ea
......@@ -22,6 +22,11 @@ svn trunk
* Allow ``pip -E`` to work with a virtualenv that uses a different
version of Python than the parent environment.
* Search the links passed in with ``-f`` for packages.
* Detect zip files, even when the file doesn't have a ``.zip``
extension and it is served with the wrong Content-Type.
0.2.1
-----
......
......@@ -929,6 +929,9 @@ class PackageFinder(object):
for location in locations:
logger.debug('* %s' % location)
found_versions = []
found_versions.extend(
self._package_versions(
[Link(url, '-f') for url in self.find_links], req.name.lower()))
for page in self._get_pages(locations, req):
logger.debug('Analyzing links from page %s' % page.url)
logger.indent += 2
......@@ -1848,7 +1851,8 @@ class RequirementSet(object):
def unpack_file(self, filename, location, content_type, link):
if (content_type == 'application/zip'
or filename.endswith('.zip')
or filename.endswith('.pybundle')):
or filename.endswith('.pybundle')
or zipfile.is_zipfile(filename)):
self.unzip_file(filename, location, flatten=not filename.endswith('.pybundle'))
elif (content_type == 'application/x-gzip'
or tarfile.is_tarfile(filename)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册