Commit e991f7f7 authored by Alain Takoudjou's avatar Alain Takoudjou

Add environnment variable to createWrapper

parent 5d65d899
......@@ -127,7 +127,8 @@ class GenericBaseRecipe(object):
path, arguments=arguments)[0]
return script
def createWrapper(self, name, command, parameters, comments=[], parameters_extra=False):
def createWrapper(self, name, command, parameters, comments=[],
parameters_extra=False, env=None):
"""
Creates a very simple (one command) shell script for process replacement.
Takes care of quoting.
......@@ -138,6 +139,10 @@ class GenericBaseRecipe(object):
for comment in comments:
lines.append('# %s' % comment)
if env:
for key in env:
lines.append('export %s=%s' % (key, env[key]))
lines.append('exec %s' % shlex.quote(command))
for param in parameters:
......
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