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
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
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):
self
.
name
=
name
self
.
location
=
options
.
get
(
'location'
,
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
name
))
if
options
.
get
(
'develop'
)
in
TRUE_VALUES
:
self
.
develop
=
True
# Set boolean values
for
key
in
[
'develop'
,
'forbid-download-cache'
]:
attribute
=
key
.
replace
(
'-'
,
'_'
)
if
options
.
get
(
key
)
in
TRUE_VALUES
:
setattr
(
self
,
attribute
,
True
)
else
:
self
.
develop
=
False
setattr
(
self
,
attribute
,
False
)
self
.
networkcache
=
buildout
.
get
(
'networkcache'
,
{})
...
...
@@ -179,10 +182,12 @@ class Recipe(object):
except
CalledProcessError
:
print
(
"Unable to download from git repository. Trying from network "
"cache..."
)
if
not
download_network_cached
(
self
.
location
,
self
.
name
,
self
.
revision
,
self
.
networkcache
):
if
os
.
path
.
exists
(
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 '
'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