# HG changeset patch # User yiluzhu # Date 1260462903 0 # Node ID 0e5978b000d1d728c7e331cf799452a172cd8c59 # Parent 0785cc0c667b5a99d936df50fc51753a182397b3 filter terminal flags up if recipe exceeds line limit diff -r 0785cc0c667b -r 0e5978b000d1 sbsv2/raptor/python/plugins/filter_terminal.py --- a/sbsv2/raptor/python/plugins/filter_terminal.py Thu Dec 10 14:00:35 2009 +0000 +++ b/sbsv2/raptor/python/plugins/filter_terminal.py Thu Dec 10 16:35:03 2009 +0000 @@ -105,7 +105,7 @@ attribute_re = re.compile("([a-z][a-z0-9]*)='([^']*)'",re.I) maxdots = 40 # if one prints dots then don't print masses - recipelinelimit = 200 # don't scan ultra-long recipes in case we run out of memory + recipelinelimit = 100 # don't scan ultra-long recipes in case we run out of memory # recipes that we think most users are interested in # and the mapping that we will use to output them as @@ -282,6 +282,7 @@ # This variable holds all recipe information self.failed = False # Recipe status self.recipeBody = [] + self.recipelineExceeded = 0 return elif text.startswith(""): # detect the end of a recipe @@ -336,6 +337,10 @@ elif text.startswith("]]>"): if self.inRecipe: self.inBody = False + if self.recipelineExceeded: + self.recipeBody.append("[filter_terminal: OUTPUT TRUNCATED: Recipe output limit exceeded; " + \ + "see logfile for full output (%s lines shown out of %s)]" % \ + (FilterTerminal.recipelinelimit, FilterTerminal.recipelinelimit + self.recipelineExceeded)) elif text.startswith("Copied"): if not self.analyseonly and not self.quiet: start = text.find(" to ") + 4 @@ -365,8 +370,11 @@ # we have to keep the output until we find out # if the recipe failed. But not all of it if it turns # out to be very long - if len(self.recipeBody) < FilterTerminal.recipelinelimit: + if len(self.recipeBody) <= FilterTerminal.recipelinelimit: self.recipeBody.append(text) + else: + self.recipelineExceeded += 1 + def logit(self): """ log a message """