Commit caa2881b authored by Jérome Perrin's avatar Jérome Perrin

slapos.recipe.build: restore support for build scripts

This fixes this error:
[2015-04-10 06:28:09,906] INFO         exec self.options['script']
[2015-04-10 06:28:09,906] INFO       File "<string>", line 6, in <module>
[2015-04-10 06:28:09,906] INFO     NameError: name 'env' is not defined

When installing busybox
parent d5dd1100
...@@ -277,6 +277,7 @@ class Script: ...@@ -277,6 +277,7 @@ class Script:
self.keep_on_error = True self.keep_on_error = True
else: else:
self.keep_on_error = False self.keep_on_error = False
def getEnvironment(self): def getEnvironment(self):
# prepare cool dictionary # prepare cool dictionary
wanted_env = {} wanted_env = {}
...@@ -313,6 +314,7 @@ class Script: ...@@ -313,6 +314,7 @@ class Script:
self.cleanup_dir_list.append(self.options['location']) self.cleanup_dir_list.append(self.options['location'])
raise shutil.Error('Directory %s already exists' % raise shutil.Error('Directory %s already exists' %
self.options['location']) self.options['location'])
env = self.getEnvironment() # env is used in script exec'ed below
exec self.options['script'] exec self.options['script']
try: try:
self._checkPromise('slapos_promise', self.options['location']) self._checkPromise('slapos_promise', self.options['location'])
...@@ -342,6 +344,7 @@ class Script: ...@@ -342,6 +344,7 @@ class Script:
if self.update_script is None: if self.update_script is None:
return None return None
try: try:
env = self.getEnvironment() # env is used in script exec'ed below
exec self.options['update_script'] exec self.options['update_script']
try: try:
self._checkPromise('slapos_update_promise', self.options['location']) self._checkPromise('slapos_update_promise', self.options['location'])
......
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