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
Łukasz Nowak
slapos.buildout
Commits
136ba144
Commit
136ba144
authored
Jun 23, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Support download/upload.
parent
519543aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
24 deletions
+33
-24
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+13
-16
src/zc/buildout/download.py
src/zc/buildout/download.py
+9
-4
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+11
-4
No files found.
src/zc/buildout/buildout.py
View file @
136ba144
...
...
@@ -354,6 +354,11 @@ class Buildout(UserDict.DictMixin):
'%r'
%
(
self
.
download_cache_url
,
self
.
download_dir_url
))
self
.
_logger
.
info
(
'Networkcache upload cache: %r, directory %r'
%
(
self
.
upload_cache_url
,
self
.
upload_dir_url
))
# expose __networkcache__* in options for easier integration
options
[
'__networkcache__download-cache-url'
]
=
self
.
download_cache_url
options
[
'__networkcache__download-dir-url'
]
=
self
.
download_dir_url
options
[
'__networkcache__upload-cache-url'
]
=
self
.
upload_cache_url
options
[
'__networkcache__upload-dir-url'
]
=
self
.
upload_dir_url
else
:
self
.
_logger
.
warning
(
'Networkcache functionality not enabled.'
)
self
.
download_cache_url
=
None
...
...
@@ -1120,21 +1125,6 @@ def _install_and_load(spec, group, entry, buildout):
dest
=
buildout_options
[
'eggs-directory'
]
path
=
[
buildout_options
[
'develop-eggs-directory'
]]
networkcache_kw
=
{}
if
LIBNETWORKCACHE_ENABLED
:
# support networkcache
networkcache_section_name
=
buildout_options
.
get
(
'networkcache-section'
)
if
networkcache_section_name
:
networkcache_section
=
buildout
[
networkcache_section_name
]
networkcache_kw
[
'download_cache_url'
]
=
networkcache_section
[
'download-cache-url'
]
networkcache_kw
[
'download_dir_url'
]
=
networkcache_section
[
'download-dir-url'
]
networkcache_kw
[
'upload_cache_url'
]
=
networkcache_section
.
get
(
'upload-cache-url'
)
networkcache_kw
[
'upload_dir_url'
]
=
networkcache_section
.
get
(
'upload-dir-url'
)
zc
.
buildout
.
easy_install
.
install
(
[
spec
],
dest
,
links
=
buildout
.
_links
,
...
...
@@ -1144,7 +1134,14 @@ def _install_and_load(spec, group, entry, buildout):
newest
=
buildout
.
newest
,
allow_hosts
=
buildout
.
_allow_hosts
,
prefer_final
=
not
buildout
.
accept_buildout_test_releases
,
**
networkcache_kw
)
download_cache_url
=
buildout_options
.
get
(
'__networkcache__download-cache-url'
),
download_dir_url
=
buildout_options
.
get
(
'__networkcache__download-dir-url'
),
upload_cache_url
=
buildout_options
.
get
(
'__networkcache__upload-cache-url'
),
upload_dir_url
=
buildout_options
.
get
(
'__networkcache__upload-dir-url'
)
)
__doing__
=
'Loading %s recipe entry %s:%s.'
,
group
,
spec
,
entry
return
pkg_resources
.
load_entry_point
(
...
...
src/zc/buildout/download.py
View file @
136ba144
...
...
@@ -71,8 +71,12 @@ class Download(object):
self
.
fallback
=
fallback
self
.
hash_name
=
hash_name
self
.
logger
=
logger
or
logging
.
getLogger
(
'zc.buildout'
)
self
.
download_dir_url
=
options
.
get
(
'sha-dir'
)
self
.
download_cache_url
=
options
.
get
(
'sha-cache'
)
self
.
download_dir_url
=
options
.
get
(
'__networkcache__download-dir-url'
)
self
.
download_cache_url
=
options
.
get
(
'__networkcache__download-cache-url'
)
self
.
upload_dir_url
=
options
.
get
(
'__networkcache__upload-dir-url'
)
self
.
upload_cache_url
=
options
.
get
(
'__networkcache__upload-cache-url'
)
@
property
def
download_cache
(
self
):
...
...
@@ -187,8 +191,9 @@ class Download(object):
raise
ChecksumError
(
'MD5 checksum mismatch downloading %r'
%
url
)
# Upload the file to networkcached.
upload_network_cached
(
self
.
download_cache_url
,
self
.
download_dir_url
,
url
,
tmp_path
,
self
.
logger
)
if
self
.
upload_cache_url
and
self
.
upload_dir_url
:
upload_network_cached
(
self
.
upload_cache_url
,
self
.
upload_dir_url
,
url
,
tmp_path
,
self
.
logger
)
finally
:
os
.
close
(
handle
)
except
:
...
...
src/zc/buildout/easy_install.py
View file @
136ba144
...
...
@@ -342,7 +342,9 @@ class Installer:
allowed_eggs_from_site_packages
=
None
,
prefer_final
=
None
,
download_dir_url
=
None
,
download_cache_url
=
None
download_cache_url
=
None
,
upload_dir_url
=
None
,
upload_cache_url
=
None
):
self
.
_dest
=
dest
self
.
_allow_hosts
=
allow_hosts
...
...
@@ -413,6 +415,8 @@ class Installer:
self
.
_download_dir_url
=
download_dir_url
self
.
_download_cache_url
=
download_cache_url
self
.
_upload_dir_url
=
upload_dir_url
self
.
_upload_cache_url
=
upload_cache_url
_allowed_eggs_from_site_packages_regex
=
None
def
allow_site_package_egg
(
self
,
name
):
...
...
@@ -718,8 +722,9 @@ class Installer:
if
not
download_network_cached
(
self
.
_download_dir_url
,
self
.
_download_cache_url
,
new_location
,
dist
.
location
,
logger
):
new_location
=
self
.
_index
.
download
(
dist
.
location
,
tmp
)
upload_network_cached
(
self
.
_download_cache_url
,
self
.
_download_dir_url
,
dist
.
location
,
new_location
,
logger
)
if
self
.
_upload_cache_url
and
self
.
_upload_dir_url
:
upload_network_cached
(
self
.
_upload_cache_url
,
self
.
_upload_dir_url
,
dist
.
location
,
new_location
,
logger
)
if
(
download_cache
and
(
realpath
(
new_location
)
==
realpath
(
dist
.
location
))
...
...
@@ -1105,7 +1110,9 @@ def install(specs, dest,
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
,
download_dir_url
=
download_dir_url
,
download_cache_url
=
download_cache_url
)
prefer_final
=
prefer_final
,
download_dir_url
=
download_dir_url
,
download_cache_url
=
download_cache_url
,
upload_dir_url
=
upload_dir_url
,
upload_cache_url
=
upload_cache_url
)
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