Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos.buildout
Commits
8002e491
Commit
8002e491
authored
Jun 15, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ShaDir is also required.
parent
aead0f51
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
13 deletions
+16
-13
src/zc/buildout/download.py
src/zc/buildout/download.py
+6
-5
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+10
-8
No files found.
src/zc/buildout/download.py
View file @
8002e491
...
...
@@ -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,8 +187,8 @@ class Download(object):
raise
ChecksumError
(
'MD5 checksum mismatch downloading %r'
%
url
)
# Upload the file to networkcached.
upload_network_cached
(
self
.
network_cache
,
url
,
tmp_path
,
self
.
logger
)
upload_network_cached
(
self
.
sha_cache
,
self
.
sha_dir
,
url
,
tmp_path
,
self
.
logger
)
finally
:
os
.
close
(
handle
)
except
:
...
...
src/zc/buildout/easy_install.py
View file @
8002e491
...
...
@@ -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,11 +712,11 @@ 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
,
dist
.
location
,
new_location
,
logger
)
upload_network_cached
(
self
.
_
sha_cache
,
self
.
_sha_dir
,
dist
.
location
,
new_location
,
logger
)
if
(
download_cache
and
(
realpath
(
new_location
)
==
realpath
(
dist
.
location
))
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment