Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.build
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
2
Merge Requests
2
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
nexedi
slapos.recipe.build
Commits
45462ad8
Commit
45462ad8
authored
Sep 05, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add forbid-download-cache parameter
parent
74c33409
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
slapos/recipe/gitclone.py
slapos/recipe/gitclone.py
+11
-6
No files found.
slapos/recipe/gitclone.py
View file @
45462ad8
...
@@ -126,10 +126,13 @@ class Recipe(object):
...
@@ -126,10 +126,13 @@ class Recipe(object):
self
.
name
=
name
self
.
name
=
name
self
.
location
=
options
.
get
(
'location'
,
self
.
location
=
options
.
get
(
'location'
,
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
name
))
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
name
))
if
options
.
get
(
'develop'
)
in
TRUE_VALUES
:
# Set boolean values
self
.
develop
=
True
for
key
in
[
'develop'
,
'forbid-download-cache'
]:
attribute
=
key
.
replace
(
'-'
,
'_'
)
if
options
.
get
(
key
)
in
TRUE_VALUES
:
setattr
(
self
,
attribute
,
True
)
else
:
else
:
self
.
develop
=
False
setattr
(
self
,
attribute
,
False
)
self
.
networkcache
=
buildout
.
get
(
'networkcache'
,
{})
self
.
networkcache
=
buildout
.
get
(
'networkcache'
,
{})
...
@@ -179,10 +182,12 @@ class Recipe(object):
...
@@ -179,10 +182,12 @@ class Recipe(object):
except
CalledProcessError
:
except
CalledProcessError
:
print
(
"Unable to download from git repository. Trying from network "
print
(
"Unable to download from git repository. Trying from network "
"cache..."
)
"cache..."
)
if
not
download_network_cached
(
self
.
location
,
self
.
name
,
self
.
revision
,
self
.
networkcache
):
if
os
.
path
.
exists
(
self
.
location
):
if
os
.
path
.
exists
(
self
.
location
):
shutil
.
rmtree
(
self
.
location
)
shutil
.
rmtree
(
self
.
location
)
if
self
.
forbid_download_cache
:
raise
UserError
(
'Impossible to clone repository.'
)
if
not
download_network_cached
(
self
.
location
,
self
.
name
,
self
.
revision
,
self
.
networkcache
):
raise
UserError
(
'Impossible to clone repository and impossible to '
raise
UserError
(
'Impossible to clone repository and impossible to '
'download from cache.'
)
'download from cache.'
)
...
...
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