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 | |
parent | bf140145a0019db42577344550fc85246ec04b39 (diff) | |
download | openembedded-core-contrib-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')
-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): if not force: shellcmd.append('--dry-run') - output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + try: + output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) - if force: - return + if force: + return - shellcmd.pop(len(shellcmd) - 1) - output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + shellcmd.pop(len(shellcmd) - 1) + output = runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) + except CmdError as err: + raise bb.BBHandledException("Applying '%s' failed:\n%s" % + (os.path.basename(patch['file']), err.output)) if not reverse: self._appendPatchFile(patch['file'], patch['strippath']) |