classes/patch: avoid backtrace when patch does not apply

We don't need to see a Python stack backtrace when a patch does not
apply, just the error output from patch, so trap these kinds of errors
and ensure that we display the message and fail the task and nothing
else.

Fixes [YOCTO #1143]

(From OE-Core rev: ce6c80a1e68c2af0b4b5fa27582ad9c9f119e5c1)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Paul Eggleton
2012-01-19 13:59:15 +00:00
committed by Richard Purdie
parent adb3ed29db
commit 11e5d7bc81
2 changed files with 9 additions and 6 deletions

View File

@@ -155,7 +155,10 @@ python patch_do_patch() {
patchset.Import({"file":local, "strippath": parm['striplevel']}, True)
except Exception as exc:
bb.fatal(str(exc))
resolver.Resolve()
try:
resolver.Resolve()
except bb.BBHandledException as e:
bb.fatal(str(e))
}
patch_do_patch[vardepsexclude] = "PATCHRESOLVE"