11"""This file contains multiple utility functions which can be used by
12validation steering files. """
21 """Update the environment with b2setup
23 This is very annoying as there is no way for sub processes to modify the
24 parent environment. And also b2setup is not inherited by sub shells. So we
25 have to run bash, source the tools, run b2setup and get all the environment
26 variables from the output.
31 f
"BELLE2_NO_TOOLS_CHECK=1 source {os.environ['BELLE2_TOOLS']}/b2setup > /dev/null && {sys.executable} -c " +
32 '\"import sys,os,pickle; sys.stdout.buffer.write(pickle.dumps(dict(os.environ)))\"')
33 output = subprocess.check_output([
"bash",
"-c", cmd])
34 newenv = pickle.loads(output)
35 os.environ.update(newenv)