From: Markus Lehtonen Date: Fri, 1 Apr 2016 15:02:42 +0000 (+0300) Subject: oe/patch: print cleaner error message when patch fails to apply X-Git-Tag: 2016-4~175 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=574405a97f956278d31d52cfc934be2840cf2fa6;p=openembedded-core.git oe/patch: print cleaner error message when patch fails to apply [YOCTO #9344] Signed-off-by: Markus Lehtonen Signed-off-by: Richard Purdie --- 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'])