--- a/sbsv2/raptor/python/plugins/filter_terminal.py Tue Nov 02 16:54:53 2010 +0800
+++ b/sbsv2/raptor/python/plugins/filter_terminal.py Fri Nov 12 14:49:36 2010 +0000
@@ -24,6 +24,7 @@
import os.path
import re
+
class Recipe(object):
"""State machine that parses a recipe
"""
@@ -100,7 +101,6 @@
Recipe.recipes.append(FreezeRecipe)
-
class FilterTerminal(filter_interface.Filter):
attribute_re = re.compile("([a-z][a-z0-9]*)='([^']*)'",re.I)
@@ -221,15 +221,23 @@
end = text.rfind("<")
self.err_count += 1
if not self.analyseonly:
- sys.stderr.write(str(raptor.name) + ": error: %s\n" \
- % text[(start + 1):end])
+ m = FilterTerminal.attribute_re.findall(text, 0, start)
+ component = ""
+ for i in m:
+ if i[0] == 'bldinf':
+ component = " (component " + i[1] + ")"
+ sys.stderr.write(self.formatError(text[(start + 1):end] + component))
elif text.startswith("<warning"):
start = text.find(">")
end = text.rfind("<")
self.warn_count += 1
if not self.analyseonly:
- sys.stdout.write(str(raptor.name) + ": warning: %s\n" \
- % text[(start + 1):end])
+ m = FilterTerminal.attribute_re.findall(text, 0, start)
+ component = ""
+ for i in m:
+ if i[0] == 'bldinf':
+ component = " (component " + i[1] + ")"
+ sys.stdout.write(self.formatWarning(text[(start + 1):end] + component))
elif text.startswith("<status "):
# detect the status report from a recipe
if text.find('failed') != -1: