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