Trees | Indices | Help |
|
---|
|
1 # This program is free software; you can 2 # redistribute it and/or modify it under the terms of the GNU General Public 3 # License as published by the Free Software Foundation, version 2. 4 # 5 # This program is distributed in the hope that it will be useful, but WITHOUT 6 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 7 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 8 # details. 9 # 10 # You should have received a copy of the GNU General Public License along with 11 # this program; if not, write to the Free Software Foundation, Inc., 51 12 # Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 13 # 14 # Portions Copyright Buildbot Team Members 15 # Portions Copyright Marius Rieder <marius.rieder@durchmesser.ch> 16 """ 17 Steps and objects related to lintian 18 """ 19 20 from buildbot.steps.shell import ShellCommand 21 from buildbot.status.results import SUCCESS, WARNINGS, FAILURE 22 from buildbot import config 2325 name = "lintian" 26 description = ["Lintian running"] 27 descriptionDone = ["Lintian"] 28 29 fileloc = None 30 suppressTags = [] 31 32 warnCount = 0 33 errCount = 0 34 35 flunkOnFailure=False 36 warnOnFailure=True 379139 """ 40 Create the DebLintian object. 41 42 @type fileloc: str 43 @param fileloc: Location of the .deb or .changes to test. 44 @type suppressTags: list 45 @param suppressTags: List of tags to suppress. 46 @type kwargs: dict 47 @param kwargs: all other keyword arguments. 48 """ 49 ShellCommand.__init__(self, **kwargs) 50 if fileloc: 51 self.fileloc = fileloc 52 if suppressTags: 53 self.suppressTags = suppressTags 54 55 if not self.fileloc: 56 config.error("You must specify a fileloc") 57 58 self.command = ["lintian", "-v", self.fileloc] 59 60 if self.suppressTags: 61 for tag in self.suppressTags: 62 self.command += ['--suppress-tags', tag]6365 """ 66 Create nice summary logs. 67 68 @param log: log to create summary off of. 69 """ 70 warnings = [] 71 errors = [] 72 for line in log.readlines(): 73 if 'W: ' in line: 74 warnings.append(line) 75 elif 'E: ' in line: 76 errors.append(line) 77 78 if warnings: 79 self.addCompleteLog('%d Warnings' % len(warnings), "".join(warnings)) 80 self.warnCount = len(warnings) 81 if errors: 82 self.addCompleteLog('%d Errors' % len(errors), "".join(errors)) 83 self.errCount = len(errors)84
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Wed Nov 21 16:23:00 2012 | http://epydoc.sourceforge.net |