1
2
3
4
5
6
7
8
9 """
10 Steps and objects related to rpmlint.
11 """
12
13 from buildbot.steps.shell import Test
14
15
17 """
18 Rpmlint build step.
19 """
20
21 description = ["Checking for RPM/SPEC issues"]
22 descriptionDone = ["Finished checking RPM/SPEC issues"]
23
24 - def __init__(self, fileloc="*rpm", **kwargs):
25 """
26 Create the Rpmlint object.
27
28 @type fileloc: str
29 @param fileloc: Location glob of the specs or rpms.
30 @type kwargs: dict
31 @param fileloc: all other keyword arguments.
32 """
33 Test.__init__(self, **kwargs)
34 self.command = ["/usr/bin/rpmlint", "-i"]
35 self.command.append(fileloc)
36
38 """
39 Create nice summary logs.
40
41 @param log: log to create summary off of.
42 """
43 warnings = []
44 errors = []
45 for line in log.readlines():
46 if ' W: ' in line:
47 warnings.append(line)
48 elif ' E: ' in line:
49 errors.append(line)
50 self.addCompleteLog('Rpmlint Warnings', "".join(warnings))
51 self.addCompleteLog('Rpmlint Errors', "".join(errors))
52