Skip to content

Commit

Permalink
RpmLint updates
Browse files Browse the repository at this point in the history
* Set buildstep name to 'rpmlint' not 'test'
* Changed fileloc default from '*rpm' to '.'. Globing did not work.
* Added config parameter to set the rpmlint user config file
* Add warning/error logs only if not empty
* Replace 'Rpmlint' with the number or warning/error in the logname
  • Loading branch information
jiuka committed Jun 2, 2012
1 parent 906976b commit 1ef312e
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions master/buildbot/steps/package/rpm/rpmlint.py
Expand Up @@ -24,21 +24,38 @@ class RpmLint(Test):
"""
Rpmlint build step.
"""

name = "rpmlint"

description = ["Checking for RPM/SPEC issues"]
descriptionDone = ["Finished checking RPM/SPEC issues"]

def __init__(self, fileloc="*rpm", **kwargs):
fileloc = '.'
config = None

def __init__(self,
fileloc=None,
config=None,
**kwargs):
"""
Create the Rpmlint object.
@type fileloc: str
@param fileloc: Location glob of the specs or rpms.
@type config: str
@param config: path to the rpmlint user config.
@type kwargs: dict
@param fileloc: all other keyword arguments.
"""
Test.__init__(self, **kwargs)
if fileloc:
self.fileloc = fileloc
if config:
self.config = config

self.command = ["/usr/bin/rpmlint", "-i"]
if self.config:
self.command += ['-f', self.config]
self.command.append(fileloc)

def createSummary(self, log):
Expand All @@ -54,5 +71,7 @@ def createSummary(self, log):
warnings.append(line)
elif ' E: ' in line:
errors.append(line)
self.addCompleteLog('Rpmlint Warnings', "".join(warnings))
self.addCompleteLog('Rpmlint Errors', "".join(errors))
if warnings:
self.addCompleteLog('%d Warnings'%len(warnings), "".join(warnings))
if errors:
self.addCompleteLog('%d Errors'%len(errors), "".join(errors))

0 comments on commit 1ef312e

Please sign in to comment.