]> code.ossystems Code Review - openembedded-core.git/commitdiff
patch: Fix exception reporting with repr()
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 25 Oct 2021 15:04:04 +0000 (16:04 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 26 Oct 2021 11:08:08 +0000 (12:08 +0100)
The exceptions generated with repre are more detailed but escaped the
newlines making them unreadable. Fix this.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/patch.bbclass

index fdf3c633bc8e85f2a52847842cf8e9b28b19f7d0..8de70254919104ae04ec1f53db8aea79bcdf2b4c 100644 (file)
@@ -150,12 +150,12 @@ python patch_do_patch() {
             patchset.Import({"file":local, "strippath": parm['striplevel']}, True)
         except Exception as exc:
             bb.utils.remove(process_tmpdir, True)
-            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], repr(exc)))
+            bb.fatal("Importing patch '%s' with striplevel '%s'\n%s" % (parm['patchname'], parm['striplevel'], repr(exc).replace("\\n", "\n")))
         try:
             resolver.Resolve()
         except bb.BBHandledException as e:
             bb.utils.remove(process_tmpdir, True)
-            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, repr(e)))
+            bb.fatal("Applying patch '%s' on target directory '%s'\n%s" % (parm['patchname'], patchdir, repr(e).replace("\\n", "\n")))
 
     bb.utils.remove(process_tmpdir, True)
     del os.environ['TMPDIR']