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
Yusei Tahara
slapos.buildout
Commits
42a4f020
Commit
42a4f020
authored
May 05, 2011
by
Lucas Carvalho
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network-cache options should not be default
parent
54a9d788
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+1
-2
src/zc/buildout/download.py
src/zc/buildout/download.py
+1
-4
src/zc/buildout/networkcache.py
src/zc/buildout/networkcache.py
+9
-2
No files found.
src/zc/buildout/buildout.py
View file @
42a4f020
...
@@ -138,7 +138,6 @@ _buildout_default_options = _annotate_section({
...
@@ -138,7 +138,6 @@ _buildout_default_options = _annotate_section({
'socket-timeout'
:
''
,
'socket-timeout'
:
''
,
'unzip'
:
'false'
,
'unzip'
:
'false'
,
'use-dependency-links'
:
'true'
,
'use-dependency-links'
:
'true'
,
'network-cache'
:
'http://127.0.0.1:5001/'
,
},
'DEFAULT_VALUE'
)
},
'DEFAULT_VALUE'
)
...
@@ -363,7 +362,7 @@ class Buildout(UserDict.DictMixin):
...
@@ -363,7 +362,7 @@ class Buildout(UserDict.DictMixin):
newest
=
self
.
newest
,
newest
=
self
.
newest
,
allow_hosts
=
self
.
_allow_hosts
,
allow_hosts
=
self
.
_allow_hosts
,
prefer_final
=
not
self
.
accept_buildout_test_releases
,
prefer_final
=
not
self
.
accept_buildout_test_releases
,
network_cache
=
options
[
'network-cache'
]
,
network_cache
=
options
.
get
(
'network-cache'
)
,
)
)
# Now copy buildout and setuptools eggs, and record destination eggs:
# Now copy buildout and setuptools eggs, and record destination eggs:
...
...
src/zc/buildout/download.py
View file @
42a4f020
...
@@ -181,13 +181,10 @@ class Download(object):
...
@@ -181,13 +181,10 @@ class Download(object):
urllib
.
_urlopener
=
url_opener
urllib
.
_urlopener
=
url_opener
handle
,
tmp_path
=
tempfile
.
mkstemp
(
prefix
=
'buildout-'
)
handle
,
tmp_path
=
tempfile
.
mkstemp
(
prefix
=
'buildout-'
)
sha256sum
=
get_sha256sum_from_networkcached
(
self
.
network_cache
,
url
,
self
.
logger
)
try
:
try
:
try
:
try
:
if
not
download_network_cached
(
self
.
network_cache
,
if
not
download_network_cached
(
self
.
network_cache
,
tmp_path
,
sha256sum
,
self
.
logger
):
tmp_path
,
self
.
logger
):
# Download from original url
# Download from original url
tmp_path
,
headers
=
urllib
.
urlretrieve
(
url
,
tmp_path
)
tmp_path
,
headers
=
urllib
.
urlretrieve
(
url
,
tmp_path
)
...
...
src/zc/buildout/networkcache.py
View file @
42a4f020
...
@@ -110,7 +110,7 @@ def get_sha256sum_from_networkcached(network_cache, url, logger):
...
@@ -110,7 +110,7 @@ def get_sha256sum_from_networkcached(network_cache, url, logger):
' %s'
%
str
(
e
))
' %s'
%
str
(
e
))
def
download_network_cached
(
network_cache
,
path
,
sha256sum
,
logger
):
def
download_network_cached
(
network_cache
,
path
,
logger
):
"""Download from a network cache provider
"""Download from a network cache provider
If something fail (providor be offline, or hash_string fail), we ignore
If something fail (providor be offline, or hash_string fail), we ignore
...
@@ -118,10 +118,14 @@ def download_network_cached(network_cache, path, sha256sum, logger):
...
@@ -118,10 +118,14 @@ def download_network_cached(network_cache, path, sha256sum, logger):
return True if download succeeded.
return True if download succeeded.
"""
"""
if
sha256sum
is
None
:
if
network_cache
in
(
None
,
''
,)
:
# Not able to use network cache
# Not able to use network cache
return
False
return
False
sha256sum
=
get_sha256sum_from_networkcached
(
network_cache
,
url
,
self
.
logger
)
url
=
os
.
path
.
join
(
network_cache
,
sha256sum
)
url
=
os
.
path
.
join
(
network_cache
,
sha256sum
)
logger
.
info
(
'Downloading from network cache %s'
%
url
)
logger
.
info
(
'Downloading from network cache %s'
%
url
)
try
:
try
:
...
@@ -177,6 +181,9 @@ def fetch_from_network_cache(network_cache, location, tmp, logger=None):
...
@@ -177,6 +181,9 @@ def fetch_from_network_cache(network_cache, location, tmp, logger=None):
""" Try to download from a network cache and preserve
""" Try to download from a network cache and preserve
original filename.
original filename.
"""
"""
if
network_cache
in
(
None
,
''
):
return
None
# Make a id from URL
# Make a id from URL
md5sum
=
_get_md5_from_url
(
location
)
md5sum
=
_get_md5_from_url
(
location
)
...
...
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