summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe/buildhistory_analysis.py
diff options
context:
space:
mode:
Diffstat (limited to 'meta/lib/oe/buildhistory_analysis.py')
-rw-r--r--meta/lib/oe/buildhistory_analysis.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index 6c6a085d19..55bd7b769d 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -19,9 +19,10 @@ import bb.utils
19# How to display fields 19# How to display fields
20list_fields = ['DEPENDS', 'RDEPENDS', 'RRECOMMENDS', 'FILES', 'FILELIST', 'USER_CLASSES', 'IMAGE_CLASSES', 'IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS'] 20list_fields = ['DEPENDS', 'RDEPENDS', 'RRECOMMENDS', 'FILES', 'FILELIST', 'USER_CLASSES', 'IMAGE_CLASSES', 'IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS']
21list_order_fields = ['PACKAGES'] 21list_order_fields = ['PACKAGES']
22defaultval_fields = ['PKG', 'PKGE', 'PKGV', 'PKGR']
22numeric_fields = ['PKGSIZE', 'IMAGESIZE'] 23numeric_fields = ['PKGSIZE', 'IMAGESIZE']
23# Fields to monitor 24# Fields to monitor
24monitor_fields = ['RDEPENDS', 'RRECOMMENDS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE'] 25monitor_fields = ['RDEPENDS', 'RRECOMMENDS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE', 'PKG', 'PKGE', 'PKGV', 'PKGR']
25# Percentage change to alert for numeric fields 26# Percentage change to alert for numeric fields
26monitor_numeric_threshold = 20 27monitor_numeric_threshold = 20
27# Image files to monitor (note that image-info.txt is handled separately) 28# Image files to monitor (note that image-info.txt is handled separately)
@@ -90,6 +91,10 @@ class ChangeRecord:
90 else: 91 else:
91 percentchg = 100 92 percentchg = 100
92 out = '%s changed from %s to %s (%s%d%%)' % (self.fieldname, self.oldvalue or "''", self.newvalue or "''", '+' if percentchg > 0 else '', percentchg) 93 out = '%s changed from %s to %s (%s%d%%)' % (self.fieldname, self.oldvalue or "''", self.newvalue or "''", '+' if percentchg > 0 else '', percentchg)
94 elif self.fieldname in defaultval_fields:
95 out = '%s changed from %s to %s' % (self.fieldname, self.oldvalue, self.newvalue)
96 if self.fieldname == 'PKG' and '[default]' in self.newvalue:
97 out += ' - may indicate debian renaming failure'
93 elif self.fieldname in ['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm']: 98 elif self.fieldname in ['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm']:
94 if self.oldvalue and self.newvalue: 99 if self.oldvalue and self.newvalue:
95 out = '%s changed:\n ' % self.fieldname 100 out = '%s changed:\n ' % self.fieldname
@@ -299,6 +304,14 @@ def compare_dict_blobs(path, ablob, bblob, report_all):
299 adict = blob_to_dict(ablob) 304 adict = blob_to_dict(ablob)
300 bdict = blob_to_dict(bblob) 305 bdict = blob_to_dict(bblob)
301 306
307 defaultvals = {}
308 defaultvals['PKG'] = os.path.basename(path)
309 defaultvals['PKGE'] = adict.get('PE', '0')
310 defaultvals['PKGV'] = adict.get('PV', '')
311 defaultvals['PKGR'] = adict.get('PR', '')
312 for key in defaultvals:
313 defaultvals[key] = '%s [default]' % defaultvals[key]
314
302 changes = [] 315 changes = []
303 keys = list(set(adict.keys()) | set(bdict.keys())) 316 keys = list(set(adict.keys()) | set(bdict.keys()))
304 for key in keys: 317 for key in keys:
@@ -327,6 +340,13 @@ def compare_dict_blobs(path, ablob, bblob, report_all):
327 blist.sort() 340 blist.sort()
328 if ' '.join(alist) == ' '.join(blist): 341 if ' '.join(alist) == ' '.join(blist):
329 continue 342 continue
343
344 if key in defaultval_fields:
345 if not astr:
346 astr = defaultvals[key]
347 elif not bstr:
348 bstr = defaultvals[key]
349
330 chg = ChangeRecord(path, key, astr, bstr, key in monitor_fields) 350 chg = ChangeRecord(path, key, astr, bstr, key in monitor_fields)
331 changes.append(chg) 351 changes.append(chg)
332 return changes 352 return changes