summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-04-01 18:02:41 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-03 15:51:36 +0100
commitbf140145a0019db42577344550fc85246ec04b39 (patch)
treeab46d0e4556ca9d5a907e8fb19ba74c318d81585
parenta2bf9e39b62eee203865cbc0e9890d98a6f57243 (diff)
downloadpoky-bf140145a0019db42577344550fc85246ec04b39.tar.gz
oe/patch: more detailed error reporting
Show the actual command that failed when raising a CmdError. Makes figuring out what actually failed much easier. [YOCTO #9344] (From OE-Core rev: 8e9c03df1810daab7171733f1713ef94d3a18ab2) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/patch.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index 2464efdbe5..6ab4427788 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -8,12 +8,14 @@ class NotFoundError(bb.BBHandledException):
8 return "Error: %s not found." % self.path 8 return "Error: %s not found." % self.path
9 9
10class CmdError(bb.BBHandledException): 10class CmdError(bb.BBHandledException):
11 def __init__(self, exitstatus, output): 11 def __init__(self, command, exitstatus, output):
12 self.command = command
12 self.status = exitstatus 13 self.status = exitstatus
13 self.output = output 14 self.output = output
14 15
15 def __str__(self): 16 def __str__(self):
16 return "Command Error: exit status: %d Output:\n%s" % (self.status, self.output) 17 return "Command Error: '%s' exited with %d Output:\n%s" % \
18 (self.command, self.status, self.output)
17 19
18 20
19def runcmd(args, dir = None): 21def runcmd(args, dir = None):
@@ -32,7 +34,7 @@ def runcmd(args, dir = None):
32 # print("cmd: %s" % cmd) 34 # print("cmd: %s" % cmd)
33 (exitstatus, output) = oe.utils.getstatusoutput(cmd) 35 (exitstatus, output) = oe.utils.getstatusoutput(cmd)
34 if exitstatus != 0: 36 if exitstatus != 0:
35 raise CmdError(exitstatus >> 8, output) 37 raise CmdError(cmd, exitstatus >> 8, output)
36 return output 38 return output
37 39
38 finally: 40 finally: