diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2016-07-07 14:48:55 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-20 11:08:16 +0100 |
commit | 380e5d80898cac4ffc9715b3f597d0b62a0643ff (patch) | |
tree | d88099f1c8d3f30275e35cc30c24b89e193cf753 /meta/lib/oeqa/utils | |
parent | 9900000d404b09a701d5368d529eb515e054e3f0 (diff) | |
download | openembedded-core-380e5d80898cac4ffc9715b3f597d0b62a0643ff.tar.gz openembedded-core-380e5d80898cac4ffc9715b3f597d0b62a0643ff.tar.bz2 openembedded-core-380e5d80898cac4ffc9715b3f597d0b62a0643ff.zip |
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
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib/oeqa/utils')
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py index 418643a1a6..4f79d15bb8 100644 --- a/meta/lib/oeqa/utils/commands.py +++ b/meta/lib/oeqa/utils/commands.py @@ -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 |