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
Ayush Tiwari
slapos.recipe.build
Commits
84fea623
Commit
84fea623
authored
Sep 06, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow patching.
parent
8934eb92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
slapos/recipe/build.py
slapos/recipe/build.py
+23
-1
No files found.
slapos/recipe/build.py
View file @
84fea623
...
@@ -325,7 +325,6 @@ class Script:
...
@@ -325,7 +325,6 @@ class Script:
self
.
logger
.
debug
(
'Cleanup directory %r'
%
d
)
self
.
logger
.
debug
(
'Cleanup directory %r'
%
d
)
shutil
.
rmtree
(
d
)
shutil
.
rmtree
(
d
)
class
Cmmi
(
Script
):
class
Cmmi
(
Script
):
"""Simple configure-make-make-install compatible with hexagonit.recipe.cmmi
"""Simple configure-make-make-install compatible with hexagonit.recipe.cmmi
...
@@ -338,6 +337,7 @@ workdir = guessworkdir(extract_dir)
...
@@ -338,6 +337,7 @@ workdir = guessworkdir(extract_dir)
configure_command = ["./configure", "--prefix=%(location)s"]
configure_command = ["./configure", "--prefix=%(location)s"]
configure_command.extend(%(configure-options)r.split())
configure_command.extend(%(configure-options)r.split())
self.logger.info('Configuring with: %%s' %% configure_command)
self.logger.info('Configuring with: %%s' %% configure_command)
self.applyPatchList(self.options.get('patches'), self.options.get('patch-options'), self.options.get('patch-binary'), workdir)
call(configure_command, cwd=workdir, env=env)
call(configure_command, cwd=workdir, env=env)
self.logger.info('Building')
self.logger.info('Building')
call("make", cwd=workdir, env=env)
call("make", cwd=workdir, env=env)
...
@@ -345,6 +345,28 @@ self.logger.info('Installing')
...
@@ -345,6 +345,28 @@ self.logger.info('Installing')
call(["make", "install"], cwd=workdir, env=env)
call(["make", "install"], cwd=workdir, env=env)
"""
"""
def
applyPatchList
(
self
,
patch_string
,
patch_options
=
None
,
patch_binary
=
None
,
cwd
=
None
):
if
patch_string
is
not
None
:
if
patch_options
is
None
:
patch_options
=
[]
else
:
patch_options
=
patch_options
.
split
(
' '
)
if
patch_binary
is
None
:
patch_binary
=
'patch'
kwargs
=
dict
()
if
cwd
is
not
None
:
kwargs
[
'cwd'
]
=
cwd
for
patch
in
patch_string
.
splitlines
():
patch
=
patch
.
strip
()
if
patch
:
if
' '
in
patch
:
patch
,
md5sum
=
patch
.
split
()
else
:
md5sum
=
None
kwargs
[
'stdin'
]
=
open
(
self
.
download
(
patch
,
md5sum
))
self
.
logger
.
info
(
'Applying patch %r'
%
patch
)
call
([
patch_binary
]
+
patch_options
,
**
kwargs
)
def
__init__
(
self
,
buildout
,
name
,
options
):
def
__init__
(
self
,
buildout
,
name
,
options
):
options
[
'configure-options'
]
=
' '
.
join
(
options
.
get
(
'configure-options'
,
options
[
'configure-options'
]
=
' '
.
join
(
options
.
get
(
'configure-options'
,
''
).
strip
().
splitlines
())
''
).
strip
().
splitlines
())
...
...
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