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
Xavier Thompson
slapos.recipe.build
Commits
849ead09
Commit
849ead09
authored
Oct 10, 2016
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
build: code cleanup
parent
49e5b835
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
slapos/recipe/build/__init__.py
slapos/recipe/build/__init__.py
+10
-11
No files found.
slapos/recipe/build/__init__.py
View file @
849ead09
...
...
@@ -263,7 +263,6 @@ class Script:
cleanup_dir_list
=
cleanup_file_list
=
property
(
lambda
self
:
self
.
cleanup_list
)
script
=
'raise NotImplementedError'
def
__init__
(
self
,
buildout
,
name
,
options
):
self
.
cleanup_list
=
[]
...
...
@@ -271,16 +270,16 @@ class Script:
self
.
buildout
=
buildout
self
.
name
=
name
self
.
logger
=
logging
.
getLogger
(
'SlapOS build of %s'
%
self
.
name
)
self
.
options
.
setdefault
(
'location'
,
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
self
.
name
))
# cleanup some variables
for
k
in
[
'location'
,
'url'
,
'md5sum'
,
'path'
]
:
try
:
self
.
options
[
'location'
]
=
self
.
options
[
'location'
].
strip
()
except
KeyError
:
self
.
options
[
'location'
]
=
os
.
path
.
join
(
buildout
[
'buildout'
][
'parts-directory'
],
self
.
name
)
for
k
in
'url'
,
'md5sum'
,
'path'
:
self
.
options
[
k
]
=
self
.
options
.
get
(
k
,
''
).
strip
()
if
self
.
options
.
get
(
'format'
,
'yes'
)
in
[
'y'
,
'yes'
,
'1'
,
'on'
]:
self
.
options
[
'script'
]
=
self
.
options
.
get
(
'script'
,
self
.
script
)
%
\
self
.
options
self
.
script
=
self
.
options
[
'script'
]
if
self
.
options
.
get
(
'format'
,
'yes'
)
in
TRUE_LIST
:
self
.
script
=
self
.
script
%
self
.
options
if
self
.
options
.
get
(
'keep-on-error'
,
''
).
strip
().
lower
()
in
TRUE_LIST
:
self
.
logger
.
debug
(
'Keeping directories in case of errors'
)
self
.
keep_on_error
=
True
...
...
@@ -324,7 +323,7 @@ class Script:
rmtree
(
location
)
env
=
self
.
getEnvironment
()
# env is used in script exec'ed below
try
:
exec
self
.
options
[
'script'
]
exec
self
.
script
self
.
_checkPromise
(
'slapos_promise'
,
location
)
except
:
self
.
cleanup_list
.
append
(
location
)
...
...
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