Commit 4321b38a authored by Łukasz Nowak's avatar Łukasz Nowak

Share applyPatchList with in base class.

parent 4a2ea3b3
......@@ -325,26 +325,6 @@ class Script:
self.logger.debug('Cleanup directory %r' % d)
shutil.rmtree(d)
class Cmmi(Script):
"""Simple configure-make-make-install compatible with hexagonit.recipe.cmmi
Compatibility on parameter level"""
script = """
url = self.download(self.options['url'], self.options.get('md5sum'))
extract_dir = self.extract(url)
workdir = guessworkdir(extract_dir)
configure_command = ["./configure", "--prefix=%(location)s"]
configure_command.extend(%(configure-options)r.split())
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)
self.logger.info('Building')
call("make", cwd=workdir, env=env)
self.logger.info('Installing')
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:
......@@ -373,6 +353,26 @@ call(["make", "install"], cwd=workdir, env=env)
self.logger.info('Applying patch %r' % patch)
call([patch_binary] + patch_options, **kwargs)
class Cmmi(Script):
"""Simple configure-make-make-install compatible with hexagonit.recipe.cmmi
Compatibility on parameter level"""
script = """
url = self.download(self.options['url'], self.options.get('md5sum'))
extract_dir = self.extract(url)
workdir = guessworkdir(extract_dir)
configure_command = ["./configure", "--prefix=%(location)s"]
configure_command.extend(%(configure-options)r.split())
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)
self.logger.info('Building')
call("make", cwd=workdir, env=env)
self.logger.info('Installing')
call(["make", "install"], cwd=workdir, env=env)
"""
def __init__(self, buildout, name, options):
options['configure-options'] = ' '.join(options.get('configure-options',
'').strip().splitlines())
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment