summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-01-19 13:59:15 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-01-19 14:34:34 +0000
commit11e5d7bc814a265d338dbb06d82e7533c2187be2 (patch)
tree5bafb67bdcad14bb22bd30f0784cc34d8a93778b /meta/lib/oe
parentadb3ed29db5973d6b43a0217c4d8052d2ff722f8 (diff)
downloadast2050-yocto-poky-11e5d7bc814a265d338dbb06d82e7533c2187be2.zip
ast2050-yocto-poky-11e5d7bc814a265d338dbb06d82e7533c2187be2.tar.gz
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>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/patch.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index f4ccb3e..6f7f900 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -2,14 +2,14 @@ import oe.path
import os
import bb.utils, bb.msg, bb.data, bb.fetch2
-class NotFoundError(Exception):
+class NotFoundError(bb.BBHandledException):
def __init__(self, path):
self.path = path
def __str__(self):
return "Error: %s not found." % self.path
-class CmdError(Exception):
+class CmdError(bb.BBHandledException):
def __init__(self, exitstatus, output):
self.status = exitstatus
self.output = output
@@ -207,7 +207,7 @@ class QuiltTree(PatchSet):
# read series -> self.patches
seriespath = os.path.join(self.dir, 'patches', 'series')
if not os.path.exists(self.dir):
- raise Exception("Error: %s does not exist." % self.dir)
+ raise NotFoundError(self.dir)
if os.path.exists(seriespath):
series = file(seriespath, 'r')
for line in series.readlines():
@@ -228,7 +228,7 @@ class QuiltTree(PatchSet):
if sys.exc_value.output.strip() == "No patches applied":
return
else:
- raise sys.exc_value
+ raise
output = [val for val in output.split('\n') if not val.startswith('#')]
for patch in self.patches:
if os.path.basename(patch["quiltfile"]) == output[-1]:
@@ -336,7 +336,7 @@ class NOOPResolver(Resolver):
except Exception:
import sys
os.chdir(olddir)
- raise sys.exc_value
+ raise
# Patch resolver which relies on the user doing all the work involved in the
# resolution, with the exception of refreshing the remote copy of the patch
OpenPOWER on IntegriCloud