diff options
Diffstat (limited to 'meta')
-rwxr-xr-x | meta/lib/oeqa/runexported.py | 16 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/commands.py | 12 |
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: | |||
31 | sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) | 31 | sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "oeqa"))) |
32 | 32 | ||
33 | from oeqa.oetest import ExportTestContext | 33 | from oeqa.oetest import ExportTestContext |
34 | from oeqa.utils.commands import runCmd | 34 | from oeqa.utils.commands import runCmd, updateEnv |
35 | from oeqa.utils.sshcontrol import SSHControl | 35 | from 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 | |||
142 | def 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 | ||
154 | if __name__ == "__main__": | 142 | if __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 | |||
265 | def 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 | ||