summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/utils/commands.py19
1 files changed, 13 insertions, 6 deletions
diff --git a/meta/lib/oeqa/utils/commands.py b/meta/lib/oeqa/utils/commands.py
index 024261410e..f733fcdf3c 100644
--- a/meta/lib/oeqa/utils/commands.py
+++ b/meta/lib/oeqa/utils/commands.py
@@ -168,15 +168,22 @@ class Result(object):
168 168
169 169
170def runCmd(command, ignore_status=False, timeout=None, assert_error=True, sync=True, 170def runCmd(command, ignore_status=False, timeout=None, assert_error=True, sync=True,
171 native_sysroot=None, limit_exc_output=0, output_log=None, **options): 171 native_sysroot=None, target_sys=None, limit_exc_output=0, output_log=None, **options):
172 result = Result() 172 result = Result()
173 173
174 if native_sysroot: 174 if native_sysroot:
175 extra_paths = "%s/sbin:%s/usr/sbin:%s/usr/bin" % \ 175 new_env = dict(options.get('env', os.environ))
176 (native_sysroot, native_sysroot, native_sysroot) 176 paths = new_env["PATH"].split(":")
177 nenv = dict(options.get('env', os.environ)) 177 paths = [
178 nenv['PATH'] = extra_paths + ':' + nenv.get('PATH', '') 178 os.path.join(native_sysroot, "bin"),
179 options['env'] = nenv 179 os.path.join(native_sysroot, "sbin"),
180 os.path.join(native_sysroot, "usr", "bin"),
181 os.path.join(native_sysroot, "usr", "sbin"),
182 ] + paths
183 if target_sys:
184 paths = [os.path.join(native_sysroot, "usr", "bin", target_sys)] + paths
185 new_env["PATH"] = ":".join(paths)
186 options['env'] = new_env
180 187
181 cmd = Command(command, timeout=timeout, output_log=output_log, **options) 188 cmd = Command(command, timeout=timeout, output_log=output_log, **options)
182 cmd.run() 189 cmd.run()