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.cmmi
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.cmmi
Commits
924f1ca5
Commit
924f1ca5
authored
Dec 06, 2021
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate slapos.recipe.build.env.sh if keep-compile-dir is true.
parent
071fd7c2
Pipeline
#18638
failed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
19 deletions
+25
-19
slapos/recipe/cmmi/__init__.py
slapos/recipe/cmmi/__init__.py
+25
-19
No files found.
slapos/recipe/cmmi/__init__.py
View file @
924f1ca5
...
...
@@ -279,26 +279,13 @@ class Recipe(EnvironMixin):
and
os
.
path
.
exists
(
self
.
buildout_prefix
)):
log
.
info
(
'Getting installed file lists'
)
parts
+=
self
.
get_installed_files
(
compile_dir
)
if
is_true
(
self
.
options
.
get
(
'keep-compile-dir'
)
or
self
.
buildout
[
'buildout'
].
get
(
'keep-compile-dir'
)):
self
.
generate_build_environment_script
(
configure_cmd
,
make_cmd
,
install_cmd
)
log
.
info
(
'A shell script slapos.recipe.build.env.sh has been generated.'
)
except
:
with
open
(
'slapos.recipe.build.env.sh'
,
'w'
)
as
env_script
:
for
key
,
v
in
sorted
(
self
.
environ
.
items
()):
if
v
!=
startup_environ
.
get
(
key
):
env_script
.
write
(
'%sexport %s=%s
\
n
'
%
(
'#'
[:
key
in
(
'TEMP'
,
'TMP'
,
'TMPDIR'
)],
key
,
quote
(
v
)))
env_script
.
write
(
'''
\
echo "If this recipe does not use pre/post hooks or commands, you can re-run as below."
echo configure with:
echo %s
echo
echo make with:
echo %s
echo
echo install with:
echo %s
'''
%
(
quote
(
" "
+
configure_cmd
),
quote
(
" "
+
make_cmd
),
quote
(
" "
+
install_cmd
)))
self
.
generate_build_environment_script
(
configure_cmd
,
make_cmd
,
install_cmd
)
log
.
error
(
'Compilation error. The package is left as is at %s where '
'you can inspect what went wrong.
\
n
'
'A shell script slapos.recipe.build.env.sh has been generated. '
...
...
@@ -320,6 +307,25 @@ echo %s
self
.
fix_shebang
(
location
)
return
parts
def
generate_build_environment_script
(
self
,
configure_cmd
,
make_cmd
,
install_cmd
):
with
open
(
'slapos.recipe.build.env.sh'
,
'w'
)
as
env_script
:
for
key
,
v
in
sorted
(
self
.
environ
.
items
()):
if
v
!=
startup_environ
.
get
(
key
):
env_script
.
write
(
'%sexport %s=%s
\
n
'
%
(
'#'
[:
key
in
(
'TEMP'
,
'TMP'
,
'TMPDIR'
)],
key
,
quote
(
v
)))
env_script
.
write
(
'''
\
echo "If this recipe does not use pre/post hooks or commands, you can re-run as below."
echo configure with:
echo %s
echo
echo make with:
echo %s
echo
echo install with:
echo %s
'''
%
(
quote
(
" "
+
configure_cmd
),
quote
(
" "
+
make_cmd
),
quote
(
" "
+
install_cmd
)))
def
fix_shebang
(
self
,
location
):
# Workaround for shebang line limit by renaming the script and
# putting a wrapper shell script.
...
...
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