summaryrefslogtreecommitdiff
path: root/meta/lib/oe/patch.py
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2016-04-01 18:02:42 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-03 15:51:08 +0100
commit574405a97f956278d31d52cfc934be2840cf2fa6 (patch)
tree5b87aef8f0c47e151f6efeddf92788771edab78b /meta/lib/oe/patch.py
parent8e9c03df1810daab7171733f1713ef94d3a18ab2 (diff)
downloadopenembedded-core-574405a97f956278d31d52cfc934be2840cf2fa6.tar.gz
openembedded-core-574405a97f956278d31d52cfc934be2840cf2fa6.tar.bz2
openembedded-core-574405a97f956278d31d52cfc934be2840cf2fa6.zip
oe/patch: print cleaner error message when patch fails to apply
[YOCTO #9344] 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/patch.py')
-rw-r--r--meta/lib/oe/patch.py14
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'])