summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rwxr-xr-xmeta/lib/oeqa/runexported.py16
-rw-r--r--meta/lib/oeqa/utils/commands.py12
2 files changed, 14 insertions, 14 deletions
diff --git a/meta/lib/oeqa/runexported.py b/meta/lib/oeqa/runexported.py
index 58867393bb..125e86d0e6 100755
--- a/meta/lib/oeqa/runexported.py
+++ b/meta/lib/oeqa/runexported.py
@@ -31,7 +31,7 @@ except ImportError:
31sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) 31sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa")))
32 32
33from oeqa.oetest import ExportTestContext 33from oeqa.oetest import ExportTestContext
34from oeqa.utils.commands import runCmd 34from oeqa.utils.commands import runCmd, updateEnv
35from oeqa.utils.sshcontrol import SSHControl 35from oeqa.utils.sshcontrol import SSHControl
36 36
37# this isn't pretty but we need a fake target object 37# this isn't pretty but we need a fake target object
@@ -137,19 +137,7 @@ def extract_sdk(d):
137 if f.startswith("environment-setup"): 137 if f.startswith("environment-setup"):
138 print("Setting up SDK environment...") 138 print("Setting up SDK environment...")
139 env_file = os.path.join(extract_path, f) 139 env_file = os.path.join(extract_path, f)
140 update_env(env_file) 140 updateEnv(env_file)
141
142def update_env(env_file):
143 """
144 Source a file and update environment
145 """
146
147 cmd = ". %s; env -0" % env_file
148 result = runCmd(cmd)
149
150 for line in result.output.split("\0"):
151 (key, _, value) = line.partition("=")
152 os.environ[key] = value
153 141
154if __name__ == "__main__": 142if __name__ == "__main__":
155 try: 143 try:
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):
261 qemu.stop() 261 qemu.stop()
262 except: 262 except:
263 pass 263 pass
264
265def updateEnv(env_file):
266 """
267 Source a file and update environment.
268 """
269
270 cmd = ". %s; env -0" % env_file
271 result = runCmd(cmd)
272
273 for line in result.output.split("\0"):
274 (key, _, value) = line.partition("=")
275 os.environ[key] = value