mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 00:59:48 +00:00
lib/oeqa/utils/commands.py: Move updateEnv() from runexported.py
updateEnv() can be used in other places so move the function to utils/commands.py (From OE-Core rev: 380e5d80898cac4ffc9715b3f597d0b62a0643ff) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
90436919f8
commit
e1aa836bb9
@@ -261,3 +261,15 @@ def runqemu(pn, ssh=True):
|
||||
qemu.stop()
|
||||
except:
|
||||
pass
|
||||
|
||||
def updateEnv(env_file):
|
||||
"""
|
||||
Source a file and update environment.
|
||||
"""
|
||||
|
||||
cmd = ". %s; env -0" % env_file
|
||||
result = runCmd(cmd)
|
||||
|
||||
for line in result.output.split("\0"):
|
||||
(key, _, value) = line.partition("=")
|
||||
os.environ[key] = value
|
||||
|
||||
Reference in New Issue
Block a user