summaryrefslogtreecommitdiffstats
path: root/scripts/lib/mic/utils/oe
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2014-02-19 14:53:37 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-20 14:28:13 +0000
commitbb0c26960d3b05070346cdfdfd05d6fd4ad0a7b1 (patch)
tree187d506936d4470b85e4e14db90d8e97e5fff1ab /scripts/lib/mic/utils/oe
parent8e894d111de3cfe86bd6c6178fb619d94b1be115 (diff)
downloadpoky-bb0c26960d3b05070346cdfdfd05d6fd4ad0a7b1.tar.gz
wic: Make exec_native_command() fail if a command isn't found
Because exec_cmd() return values can in certain cases be non-zero yet non-fatal, we don't want to automatically make them fatal (though there should at least be a warning in such cases, which this patch also does); non-zero return values are definitely fatal however if they mean that a native command wasn't found, so have exec_native_cmd() check the return value of exec_cmd() for that case, and bail out if so. [YOCTO #5835] (From OE-Core rev: 43ac6e3216c5d985d6f90a28e727e397df616267) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/mic/utils/oe')
-rw-r--r--scripts/lib/mic/utils/oe/misc.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/mic/utils/oe/misc.py b/scripts/lib/mic/utils/oe/misc.py
index d65b77a7aa..7ad3aa9685 100644
--- a/scripts/lib/mic/utils/oe/misc.py
+++ b/scripts/lib/mic/utils/oe/misc.py
@@ -51,7 +51,7 @@ def exec_cmd(cmd_and_args, as_shell = False, catch = 3):
51 # parted always fails to reload part table with loop devices. This 51 # parted always fails to reload part table with loop devices. This
52 # prevents us from distinguishing real errors based on return 52 # prevents us from distinguishing real errors based on return
53 # code. 53 # code.
54 msger.debug("WARNING: %s returned '%s' instead of 0" % (args[0], rc)) 54 msger.warning("WARNING: %s returned '%s' instead of 0" % (cmd_and_args, rc))
55 55
56 return (rc, out) 56 return (rc, out)
57 57
@@ -82,7 +82,14 @@ def exec_native_cmd(cmd_and_args, native_sysroot, catch = 3):
82 args = cmd_and_args.split() 82 args = cmd_and_args.split()
83 msger.debug(args) 83 msger.debug(args)
84 84
85 return exec_cmd(native_cmd_and_args, True, catch) 85 rc, out = exec_cmd(native_cmd_and_args, True, catch)
86
87 if rc == 127: # shell command-not-found
88 msger.error("A native (host) program required to build the image "
89 "was not found (see details above). Please make sure "
90 "it's installed and try again.")
91
92 return (rc, out)
86 93
87 94
88def exec_native_cmd_quiet(cmd_and_args, native_sysroot): 95def exec_native_cmd_quiet(cmd_and_args, native_sysroot):