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
Jérome Perrin
slapos.buildout
Commits
73b544e5
Commit
73b544e5
authored
Jun 23, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove specific cache naming.
parent
37efda8d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
27 deletions
+27
-27
src/zc/buildout/buildout.py
src/zc/buildout/buildout.py
+6
-6
src/zc/buildout/download.py
src/zc/buildout/download.py
+4
-4
src/zc/buildout/easy_install.py
src/zc/buildout/easy_install.py
+8
-8
src/zc/buildout/networkcache.py
src/zc/buildout/networkcache.py
+7
-7
zc.recipe.egg_/src/zc/recipe/egg/egg.py
zc.recipe.egg_/src/zc/recipe/egg/egg.py
+2
-2
No files found.
src/zc/buildout/buildout.py
View file @
73b544e5
...
@@ -396,8 +396,8 @@ class Buildout(UserDict.DictMixin):
...
@@ -396,8 +396,8 @@ 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
,
sha_cache
=
self
.
download_cache_url
,
download_cache_url
=
self
.
download_cache_url
,
sha_dir
=
self
.
download_dir_url
,
download_dir_url
=
self
.
download_dir_url
,
)
)
# Now copy buildout and setuptools eggs, and record destination eggs:
# Now copy buildout and setuptools eggs, and record destination eggs:
...
@@ -899,8 +899,8 @@ class Buildout(UserDict.DictMixin):
...
@@ -899,8 +899,8 @@ class Buildout(UserDict.DictMixin):
path
=
[
options
[
'develop-eggs-directory'
]],
path
=
[
options
[
'develop-eggs-directory'
]],
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
,
sha_cache
=
self
.
download_cache_url
,
download_cache_url
=
self
.
download_cache_url
,
sha_dir
=
self
.
download_dir_url
,
download_dir_url
=
self
.
download_dir_url
,
)
)
upgraded
=
[]
upgraded
=
[]
...
@@ -1129,8 +1129,8 @@ def _install_and_load(spec, group, entry, buildout):
...
@@ -1129,8 +1129,8 @@ def _install_and_load(spec, group, entry, buildout):
newest
=
buildout
.
newest
,
newest
=
buildout
.
newest
,
allow_hosts
=
buildout
.
_allow_hosts
,
allow_hosts
=
buildout
.
_allow_hosts
,
prefer_final
=
not
buildout
.
accept_buildout_test_releases
,
prefer_final
=
not
buildout
.
accept_buildout_test_releases
,
sha_cache
=
self
.
download_cache_url
,
download_cache_url
=
self
.
download_cache_url
,
sha_dir
=
self
.
download_dir_url
)
download_dir_url
=
self
.
download_dir_url
)
__doing__
=
'Loading %s recipe entry %s:%s.'
,
group
,
spec
,
entry
__doing__
=
'Loading %s recipe entry %s:%s.'
,
group
,
spec
,
entry
return
pkg_resources
.
load_entry_point
(
return
pkg_resources
.
load_entry_point
(
...
...
src/zc/buildout/download.py
View file @
73b544e5
...
@@ -71,8 +71,8 @@ class Download(object):
...
@@ -71,8 +71,8 @@ class Download(object):
self
.
fallback
=
fallback
self
.
fallback
=
fallback
self
.
hash_name
=
hash_name
self
.
hash_name
=
hash_name
self
.
logger
=
logger
or
logging
.
getLogger
(
'zc.buildout'
)
self
.
logger
=
logger
or
logging
.
getLogger
(
'zc.buildout'
)
self
.
sha_dir
=
options
.
get
(
'sha-dir'
)
self
.
download_dir_url
=
options
.
get
(
'sha-dir'
)
self
.
sha_cache
=
options
.
get
(
'sha-cache'
)
self
.
download_cache_url
=
options
.
get
(
'sha-cache'
)
@
property
@
property
def
download_cache
(
self
):
def
download_cache
(
self
):
...
@@ -178,7 +178,7 @@ class Download(object):
...
@@ -178,7 +178,7 @@ class Download(object):
try
:
try
:
try
:
try
:
if
not
download_network_cached
(
self
.
sha_dir
,
self
.
sha_cache
,
if
not
download_network_cached
(
self
.
download_dir_url
,
self
.
download_cache_url
,
tmp_path
,
url
,
self
.
logger
,
md5sum
):
tmp_path
,
url
,
self
.
logger
,
md5sum
):
# Download from original url
# Download from original url
...
@@ -187,7 +187,7 @@ class Download(object):
...
@@ -187,7 +187,7 @@ class Download(object):
raise
ChecksumError
(
raise
ChecksumError
(
'MD5 checksum mismatch downloading %r'
%
url
)
'MD5 checksum mismatch downloading %r'
%
url
)
# Upload the file to networkcached.
# Upload the file to networkcached.
upload_network_cached
(
self
.
sha_cache
,
self
.
sha_dir
,
url
,
upload_network_cached
(
self
.
download_cache_url
,
self
.
download_dir_url
,
url
,
tmp_path
,
self
.
logger
)
tmp_path
,
self
.
logger
)
finally
:
finally
:
os
.
close
(
handle
)
os
.
close
(
handle
)
...
...
src/zc/buildout/easy_install.py
View file @
73b544e5
...
@@ -341,8 +341,8 @@ class Installer:
...
@@ -341,8 +341,8 @@ class Installer:
include_site_packages
=
None
,
include_site_packages
=
None
,
allowed_eggs_from_site_packages
=
None
,
allowed_eggs_from_site_packages
=
None
,
prefer_final
=
None
,
prefer_final
=
None
,
sha_dir
=
None
,
download_dir_url
=
None
,
sha_cache
=
None
download_cache_url
=
None
):
):
self
.
_dest
=
dest
self
.
_dest
=
dest
self
.
_allow_hosts
=
allow_hosts
self
.
_allow_hosts
=
allow_hosts
...
@@ -411,8 +411,8 @@ class Installer:
...
@@ -411,8 +411,8 @@ class Installer:
if
versions
is
not
None
:
if
versions
is
not
None
:
self
.
_versions
=
versions
self
.
_versions
=
versions
self
.
_
sha_dir
=
sha_dir
self
.
_
download_dir_url
=
download_dir_url
self
.
_
sha_cache
=
sha_cache
self
.
_
download_cache_url
=
download_cache_url
_allowed_eggs_from_site_packages_regex
=
None
_allowed_eggs_from_site_packages_regex
=
None
def
allow_site_package_egg
(
self
,
name
):
def
allow_site_package_egg
(
self
,
name
):
...
@@ -715,10 +715,10 @@ class Installer:
...
@@ -715,10 +715,10 @@ class Installer:
filename
=
get_filename_from_url
(
dist
.
location
)
filename
=
get_filename_from_url
(
dist
.
location
)
new_location
=
os
.
path
.
join
(
tmp
,
filename
)
new_location
=
os
.
path
.
join
(
tmp
,
filename
)
if
not
download_network_cached
(
self
.
_
sha_dir
,
self
.
_sha_cache
,
if
not
download_network_cached
(
self
.
_
download_dir_url
,
self
.
_download_cache_url
,
new_location
,
dist
.
location
,
logger
):
new_location
,
dist
.
location
,
logger
):
new_location
=
self
.
_index
.
download
(
dist
.
location
,
tmp
)
new_location
=
self
.
_index
.
download
(
dist
.
location
,
tmp
)
upload_network_cached
(
self
.
_
sha_cache
,
self
.
_sha_dir
,
upload_network_cached
(
self
.
_
download_cache_url
,
self
.
_download_dir_url
,
dist
.
location
,
new_location
,
logger
)
dist
.
location
,
new_location
,
logger
)
if
(
download_cache
if
(
download_cache
...
@@ -1098,13 +1098,13 @@ def install(specs, dest,
...
@@ -1098,13 +1098,13 @@ def install(specs, dest,
path
=
None
,
working_set
=
None
,
newest
=
True
,
versions
=
None
,
path
=
None
,
working_set
=
None
,
newest
=
True
,
versions
=
None
,
use_dependency_links
=
None
,
allow_hosts
=
(
'*'
,),
use_dependency_links
=
None
,
allow_hosts
=
(
'*'
,),
include_site_packages
=
None
,
allowed_eggs_from_site_packages
=
None
,
include_site_packages
=
None
,
allowed_eggs_from_site_packages
=
None
,
prefer_final
=
None
,
sha_dir
=
None
,
sha_cache
=
None
):
prefer_final
=
None
,
download_dir_url
=
None
,
download_cache_url
=
None
):
installer
=
Installer
(
installer
=
Installer
(
dest
,
links
,
index
,
executable
,
always_unzip
,
path
,
newest
,
dest
,
links
,
index
,
executable
,
always_unzip
,
path
,
newest
,
versions
,
use_dependency_links
,
allow_hosts
=
allow_hosts
,
versions
,
use_dependency_links
,
allow_hosts
=
allow_hosts
,
include_site_packages
=
include_site_packages
,
include_site_packages
=
include_site_packages
,
allowed_eggs_from_site_packages
=
allowed_eggs_from_site_packages
,
allowed_eggs_from_site_packages
=
allowed_eggs_from_site_packages
,
prefer_final
=
prefer_final
,
sha_dir
=
sha_dir
,
sha_cache
=
sha_cache
)
prefer_final
=
prefer_final
,
download_dir_url
=
download_dir_url
,
download_cache_url
=
download_cache_url
)
return
installer
.
install
(
specs
,
working_set
)
return
installer
.
install
(
specs
,
working_set
)
...
...
src/zc/buildout/networkcache.py
View file @
73b544e5
...
@@ -51,7 +51,7 @@ def get_directory_key(url):
...
@@ -51,7 +51,7 @@ def get_directory_key(url):
return
'slapos-buildout-%s'
%
urlmd5
return
'slapos-buildout-%s'
%
urlmd5
def
download_network_cached
(
sha_dir
,
sha_cache
,
path
,
url
,
logger
,
md5sum
=
None
):
def
download_network_cached
(
download_dir_url
,
download_cache_url
,
path
,
url
,
logger
,
md5sum
=
None
):
"""Downloads from a network cache provider
"""Downloads 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
...
@@ -62,7 +62,7 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
...
@@ -62,7 +62,7 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
if
not
LIBNETWORKCACHE_ENABLED
:
if
not
LIBNETWORKCACHE_ENABLED
:
return
False
return
False
if
sha_cache
in
(
None
,
''
,):
if
download_cache_url
in
(
None
,
''
,):
# Not able to use network cache
# Not able to use network cache
return
False
return
False
if
md5sum
is
None
:
if
md5sum
is
None
:
...
@@ -74,7 +74,7 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
...
@@ -74,7 +74,7 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
logger
.
info
(
'Downloading %s from network cache.'
%
file_name
)
logger
.
info
(
'Downloading %s from network cache.'
%
file_name
)
try
:
try
:
nc
=
NetworkcacheClient
(
shacache
=
sha_cache
,
shadir
=
sha_dir
)
nc
=
NetworkcacheClient
(
shacache
=
download_cache_url
,
shadir
=
download_dir_url
)
file_content
=
nc
.
select
(
directory_key
)
file_content
=
nc
.
select
(
directory_key
)
f
=
open
(
path
,
'w+b'
)
f
=
open
(
path
,
'w+b'
)
...
@@ -95,12 +95,12 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
...
@@ -95,12 +95,12 @@ def download_network_cached(sha_dir, sha_cache, path, url, logger, md5sum=None):
return
True
return
True
def
upload_network_cached
(
sha_cache
,
sha_dir
,
external_url
,
path
,
logger
):
def
upload_network_cached
(
download_cache_url
,
download_dir_url
,
external_url
,
path
,
logger
):
"""Upload file to a network cache server"""
"""Upload file to a network cache server"""
if
not
LIBNETWORKCACHE_ENABLED
:
if
not
LIBNETWORKCACHE_ENABLED
:
return
False
return
False
if
sha_cache
in
[
None
,
''
]
or
sha_dir
in
[
None
,
''
]:
if
download_cache_url
in
[
None
,
''
]
or
download_dir_url
in
[
None
,
''
]:
logger
.
debug
(
logger
.
debug
(
'Upload cache ignored, shacache or shadir was not provided!'
)
'Upload cache ignored, shacache or shadir was not provided!'
)
return
False
return
False
...
@@ -112,8 +112,8 @@ def upload_network_cached(sha_cache, sha_dir, external_url, path, logger):
...
@@ -112,8 +112,8 @@ def upload_network_cached(sha_cache, sha_dir, external_url, path, logger):
f
=
open
(
path
,
'r'
)
f
=
open
(
path
,
'r'
)
try
:
try
:
nc
=
NetworkcacheClient
(
shacache
=
sha_cache
,
nc
=
NetworkcacheClient
(
shacache
=
download_cache_url
,
shadir
=
sha_dir
)
shadir
=
download_dir_url
)
data
=
nc
.
upload
(
f
,
directory_key
,
**
kw
)
data
=
nc
.
upload
(
f
,
directory_key
,
**
kw
)
except
(
IOError
,
UploadError
),
e
:
except
(
IOError
,
UploadError
),
e
:
logger
.
info
(
'Fail to upload file. %s'
%
\
logger
.
info
(
'Fail to upload file. %s'
%
\
...
...
zc.recipe.egg_/src/zc/recipe/egg/egg.py
View file @
73b544e5
...
@@ -89,9 +89,9 @@ class Eggs(object):
...
@@ -89,9 +89,9 @@ class Eggs(object):
if
'unzip'
in
options
:
if
'unzip'
in
options
:
kw
[
'always_unzip'
]
=
options
.
query_bool
(
'unzip'
,
None
)
kw
[
'always_unzip'
]
=
options
.
query_bool
(
'unzip'
,
None
)
if
'sha-cache'
in
b_options
:
if
'sha-cache'
in
b_options
:
kw
[
'
sha_cache
'
]
=
b_options
.
get
(
'sha-cache'
)
kw
[
'
download_cache_url
'
]
=
b_options
.
get
(
'sha-cache'
)
if
'sha-dir'
in
b_options
:
if
'sha-dir'
in
b_options
:
kw
[
'
sha_dir
'
]
=
b_options
.
get
(
'sha-dir'
)
kw
[
'
download_dir_url
'
]
=
b_options
.
get
(
'sha-dir'
)
ws
=
zc
.
buildout
.
easy_install
.
install
(
ws
=
zc
.
buildout
.
easy_install
.
install
(
distributions
,
options
[
'eggs-directory'
],
distributions
,
options
[
'eggs-directory'
],
...
...
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