Commit 74757bcb authored by Julien Muchembled's avatar Julien Muchembled

Reset environment variables on rebootstrap

This is useful when a recipe modifies the environment during install/update.
parent 31891ee4
...@@ -19,6 +19,7 @@ from zc.buildout import easy_install, UserError ...@@ -19,6 +19,7 @@ from zc.buildout import easy_install, UserError
class extension(object): class extension(object):
def __init__(self, buildout): def __init__(self, buildout):
self.environ = os.environ.copy()
self.buildout = buildout self.buildout = buildout
# fetch section to build python (default value is 'buildout') # fetch section to build python (default value is 'buildout')
self.python_section = buildout['buildout']['python'].strip() self.python_section = buildout['buildout']['python'].strip()
...@@ -81,7 +82,7 @@ Buildout will be restarted automatically to have this change applied. ...@@ -81,7 +82,7 @@ Buildout will be restarted automatically to have this change applied.
] + list(map(cache, get_distributions()))) ] + list(map(cache, get_distributions())))
shutil.copy(new_bin, installed) shutil.copy(new_bin, installed)
os.execv(self.wanted_python, [self.wanted_python] + sys.argv) os.execve(self.wanted_python, [self.wanted_python] + sys.argv, self.environ)
def _compute_part_signatures(self, install_parts): def _compute_part_signatures(self, install_parts):
# Skip signature check for parts that were required to build the wanted # Skip signature check for parts that were required to build the wanted
......
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