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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
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
Show 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):
...
@@ -71,7 +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
.
network_cache
=
options
.
get
(
'network-cache'
)
self
.
sha_dir
=
options
.
get
(
'sha-dir'
)
self
.
sha_cache
=
options
.
get
(
'sha-cache'
)
@
property
@
property
def
download_cache
(
self
):
def
download_cache
(
self
):
...
@@ -177,8 +178,8 @@ class Download(object):
...
@@ -177,8 +178,8 @@ class Download(object):
try
:
try
:
try
:
try
:
if
not
download_network_cached
(
self
.
network_cache
,
tmp_path
,
if
not
download_network_cached
(
self
.
sha_dir
,
self
.
sha_cache
,
url
,
self
.
logger
,
md5sum
):
tmp_path
,
url
,
self
.
logger
,
md5sum
):
# Download from original url
# Download from original url
tmp_path
,
headers
=
urllib
.
urlretrieve
(
url
,
tmp_path
)
tmp_path
,
headers
=
urllib
.
urlretrieve
(
url
,
tmp_path
)
...
@@ -186,7 +187,7 @@ class Download(object):
...
@@ -186,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
.
network_cache
,
url
,
upload_network_cached
(
self
.
sha_cache
,
self
.
sha_dir
,
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 @
8002e491
...
@@ -338,7 +338,8 @@ class Installer:
...
@@ -338,7 +338,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
,
network_cache
=
None
,
sha_dir
=
None
,
sha_cache
=
None
):
):
self
.
_dest
=
dest
self
.
_dest
=
dest
self
.
_allow_hosts
=
allow_hosts
self
.
_allow_hosts
=
allow_hosts
...
@@ -407,7 +408,8 @@ class Installer:
...
@@ -407,7 +408,8 @@ class Installer:
if
versions
is
not
None
:
if
versions
is
not
None
:
self
.
_versions
=
versions
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
_allowed_eggs_from_site_packages_regex
=
None
def
allow_site_package_egg
(
self
,
name
):
def
allow_site_package_egg
(
self
,
name
):
...
@@ -710,10 +712,10 @@ class Installer:
...
@@ -710,10 +712,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
.
_
network_cache
,
new_location
,
if
not
download_network_cached
(
self
.
_
sha_dir
,
self
.
_sha_cache
,
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
.
_
network_cache
,
upload_network_cached
(
self
.
_
sha_cache
,
self
.
_sha_dir
,
dist
.
location
,
new_location
,
logger
)
dist
.
location
,
new_location
,
logger
)
if
(
download_cache
if
(
download_cache
...
@@ -1093,13 +1095,13 @@ def install(specs, dest,
...
@@ -1093,13 +1095,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
,
network
_cache
=
None
):
prefer_final
=
None
,
sha_dir
=
None
,
sha
_cache
=
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
,
network_cache
=
network
_cache
)
prefer_final
=
prefer_final
,
sha_dir
=
sha_dir
,
sha_cache
=
sha
_cache
)
return
installer
.
install
(
specs
,
working_set
)
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