Commit 8002e491 authored by Lucas Carvalho's avatar Lucas Carvalho

ShaDir is also required.

parent aead0f51
......@@ -71,7 +71,8 @@ class Download(object):
self.fallback = fallback
self.hash_name = hash_name
self.logger = logger or logging.getLogger('zc.buildout')
self.network_cache = options.get('network-cache')
self.sha_dir = options.get('sha-dir')
self.sha_cache = options.get('sha-cache')
@property
def download_cache(self):
......@@ -177,8 +178,8 @@ class Download(object):
try:
try:
if not download_network_cached(self.network_cache, tmp_path,
url, self.logger, md5sum):
if not download_network_cached(self.sha_dir, self.sha_cache,
tmp_path, url, self.logger, md5sum):
# Download from original url
tmp_path, headers = urllib.urlretrieve(url, tmp_path)
......@@ -186,7 +187,7 @@ class Download(object):
raise ChecksumError(
'MD5 checksum mismatch downloading %r' % url)
# Upload the file to networkcached.
upload_network_cached(self.network_cache, url,
upload_network_cached(self.sha_cache, self.sha_dir, url,
tmp_path, self.logger)
finally:
os.close(handle)
......
......@@ -338,7 +338,8 @@ class Installer:
include_site_packages=None,
allowed_eggs_from_site_packages=None,
prefer_final=None,
network_cache=None,
sha_dir=None,
sha_cache=None
):
self._dest = dest
self._allow_hosts = allow_hosts
......@@ -407,7 +408,8 @@ class Installer:
if versions is not None:
self._versions = versions
self._network_cache = network_cache
self._sha_dir = sha_dir
self._sha_cache = sha_cache
_allowed_eggs_from_site_packages_regex = None
def allow_site_package_egg(self, name):
......@@ -710,10 +712,10 @@ class Installer:
filename = get_filename_from_url(dist.location)
new_location = os.path.join(tmp, filename)
if not download_network_cached(self._network_cache, new_location,
dist.location, logger):
if not download_network_cached(self._sha_dir, self._sha_cache,
new_location, dist.location, logger):
new_location = self._index.download(dist.location, tmp)
upload_network_cached(self._network_cache,
upload_network_cached(self._sha_cache, self._sha_dir,
dist.location, new_location, logger)
if (download_cache
......@@ -1093,13 +1095,13 @@ def install(specs, dest,
path=None, working_set=None, newest=True, versions=None,
use_dependency_links=None, allow_hosts=('*',),
include_site_packages=None, allowed_eggs_from_site_packages=None,
prefer_final=None, network_cache=None):
prefer_final=None, sha_dir=None, sha_cache=None):
installer = Installer(
dest, links, index, executable, always_unzip, path, newest,
versions, use_dependency_links, allow_hosts=allow_hosts,
include_site_packages=include_site_packages,
allowed_eggs_from_site_packages=allowed_eggs_from_site_packages,
prefer_final=prefer_final, network_cache=network_cache)
prefer_final=prefer_final, sha_dir=sha_dir, sha_cache=sha_cache)
return installer.install(specs, working_set)
......
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