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
Boxiang Sun
slapos.recipe.build
Commits
840d68c8
Commit
840d68c8
authored
Sep 05, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not force promise.
Additionaly support slapos_update_promise
parent
23b84958
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
+12
-3
slapos/recipe/build.py
slapos/recipe/build.py
+12
-3
No files found.
slapos/recipe/build.py
View file @
840d68c8
...
...
@@ -104,10 +104,14 @@ def guessPlatform():
class
Script
:
"""Free script building system"""
def
_checkPromise
(
self
,
location
):
def
_checkPromise
(
self
,
promise_key
,
location
):
promise_text
=
self
.
options
.
get
(
promise_key
)
if
promise_text
is
None
:
self
.
logger
.
warning
(
'Promise %r not defined'
%
promise_key
)
return
True
promise_problem_list
=
[]
a
=
promise_problem_list
.
append
for
promise
in
self
.
options
[
'slapos_promise'
]
.
split
(
'
\
n
'
):
for
promise
in
promise_text
.
split
(
'
\
n
'
):
promise
=
promise
.
strip
()
if
not
promise
:
continue
...
...
@@ -279,7 +283,7 @@ class Script:
env
=
self
.
getEnvironment
()
exec
self
.
options
[
'script'
]
try
:
self
.
_checkPromise
(
self
.
options
[
'location'
])
self
.
_checkPromise
(
'slapos_promise'
,
self
.
options
[
'location'
])
except
Exception
:
if
os
.
path
.
exists
(
self
.
options
[
'location'
]):
self
.
logger
.
info
(
'Removing location %r because of error'
%
...
...
@@ -300,6 +304,11 @@ class Script:
try
:
env
=
self
.
getEnvironment
()
exec
self
.
options
[
'update_script'
]
try
:
self
.
_checkPromise
(
'slapos_update_promise'
,
self
.
options
[
'location'
])
except
Exception
:
self
.
logger
.
info
(
'Keeping location %r during update'
%
self
.
options
[
'location'
])
raise
finally
:
for
d
in
self
.
cleanup_dir_list
:
if
os
.
path
.
exists
(
d
):
...
...
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