summaryrefslogtreecommitdiffstats
path: root/scripts/lib/buildstats.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/buildstats.py')
-rw-r--r--scripts/lib/buildstats.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/scripts/lib/buildstats.py b/scripts/lib/buildstats.py
index b1c9e617c6..d9aadf3cb8 100644
--- a/scripts/lib/buildstats.py
+++ b/scripts/lib/buildstats.py
@@ -157,9 +157,9 @@ class BSRecipe(object):
157 self.version = version 157 self.version = version
158 self.revision = revision 158 self.revision = revision
159 if epoch is None: 159 if epoch is None:
160 self.nevr = "{}-{}-{}".format(name, version, revision) 160 self.evr = "{}-{}".format(version, revision)
161 else: 161 else:
162 self.nevr = "{}-{}_{}-{}".format(name, epoch, version, revision) 162 self.evr = "{}_{}-{}".format(epoch, version, revision)
163 self.tasks = {} 163 self.tasks = {}
164 164
165 def aggregate(self, bsrecipe): 165 def aggregate(self, bsrecipe):
@@ -176,6 +176,10 @@ class BSRecipe(object):
176 self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]]) 176 self.tasks[taskname] = BSTaskAggregate([self.tasks[taskname]])
177 self.tasks[taskname].append(taskdata) 177 self.tasks[taskname].append(taskdata)
178 178
179 @property
180 def nevr(self):
181 return self.name + '-' + self.evr
182
179 183
180class BuildStats(dict): 184class BuildStats(dict):
181 """Class representing buildstats of one build""" 185 """Class representing buildstats of one build"""
@@ -323,6 +327,7 @@ class BSVerDiff(object):
323 self.vchanged = {} 327 self.vchanged = {}
324 self.rchanged = {} 328 self.rchanged = {}
325 self.unchanged = {} 329 self.unchanged = {}
330 self.empty_diff = False
326 331
327 common = recipes2.intersection(recipes1) 332 common = recipes2.intersection(recipes1)
328 if common: 333 if common:
@@ -336,3 +341,9 @@ class BSVerDiff(object):
336 self.rchanged[recipe] = rdiff 341 self.rchanged[recipe] = rdiff
337 else: 342 else:
338 self.unchanged[recipe] = rdiff 343 self.unchanged[recipe] = rdiff
344
345 if len(recipes1) == len(recipes2) == len(self.unchanged):
346 self.empty_diff = True
347
348 def __bool__(self):
349 return not self.empty_diff