diff options
Diffstat (limited to 'yocto-poky/scripts/lib/wic/utils/oe/misc.py')
-rw-r--r-- | yocto-poky/scripts/lib/wic/utils/oe/misc.py | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/yocto-poky/scripts/lib/wic/utils/oe/misc.py b/yocto-poky/scripts/lib/wic/utils/oe/misc.py index c6d2e5f20..81239ac35 100644 --- a/yocto-poky/scripts/lib/wic/utils/oe/misc.py +++ b/yocto-poky/scripts/lib/wic/utils/oe/misc.py @@ -89,7 +89,7 @@ def cmd_in_path(cmd, path): return bb.utils.which(path, cmd) != "" or False -def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): +def exec_native_cmd(cmd_and_args, native_sysroot, catch=3, pseudo=""): """ Execute native command, catching stderr, stdout @@ -97,6 +97,12 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): Always need to execute native commands as_shell """ + # The reason -1 is used is because there may be "export" commands. + args = cmd_and_args.split(';')[-1].split() + msger.debug(args) + + if pseudo: + cmd_and_args = pseudo + cmd_and_args native_paths = \ "%s/sbin:%s/usr/sbin:%s/usr/bin" % \ (native_sysroot, native_sysroot, native_sysroot) @@ -104,18 +110,16 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch=3): (native_paths, cmd_and_args) msger.debug("exec_native_cmd: %s" % cmd_and_args) - # The reason -1 is used is because there may be "export" commands. - args = cmd_and_args.split(';')[-1].split() - msger.debug(args) - # If the command isn't in the native sysroot say we failed. if cmd_in_path(args[0], native_paths): ret, out = _exec_cmd(native_cmd_and_args, True, catch) else: ret = 127 - if ret == 127: # shell command-not-found - prog = args[0] + prog = args[0] + # shell command-not-found + if ret == 127 \ + or (pseudo and ret == 1 and out == "Can't find '%s' in $PATH." % prog): msg = "A native program %s required to build the image "\ "was not found (see details above).\n\n" % prog recipe = NATIVE_RECIPES.get(prog) |