diff options
author | Markus Lehtonen <markus.lehtonen@linux.intel.com> | 2016-04-01 18:02:42 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-03 15:51:36 +0100 |
commit | fc8b24d8e0cded78ad168b8a4ebc553a11b62f64 (patch) | |
tree | a13451336610446634d90fd8e160c7113631affd /meta/lib/oe | |
parent | bf140145a0019db42577344550fc85246ec04b39 (diff) | |
download | poky-fc8b24d8e0cded78ad168b8a4ebc553a11b62f64.tar.gz |
oe/patch: print cleaner error message when patch fails to apply
[YOCTO #9344]
(From OE-Core rev: 574405a97f956278d31d52cfc934be2840cf2fa6)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r-- | meta/lib/oe/patch.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py index 6ab4427788..9d36172909 100644 --- a/meta/lib/oe/patch.py +++ b/meta/lib/oe/patch.py | |||
@@ -214,13 +214,17 @@ class PatchTree(PatchSet): | |||
214 | if not force: | 214 | if not force: |
215 | shellcmd.append('--dry-run') | 215 | shellcmd.append('--dry-run') |
216 | 216 | ||
217 | output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) | 217 | try: |
218 | output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) | ||
218 | 219 | ||
219 | if force: | 220 | if force: |
220 | return | 221 | return |
221 | 222 | ||
222 | shellcmd.pop(len(shellcmd) - 1) | 223 | shellcmd.pop(len(shellcmd) - 1) |
223 | output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) | 224 | output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) |
225 | except CmdError as err: | ||
226 | raise bb.BBHandledException("Applying '%s' failed:\n%s" % | ||
227 | (os.path.basename(patch['file']), err.output)) | ||
224 | 228 | ||
225 | if not reverse: | 229 | if not reverse: |
226 | self._appendPatchFile(patch['file'], patch['strippath']) | 230 | self._appendPatchFile(patch['file'], patch['strippath']) |