summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2012-08-02 10:23:05 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-08-06 15:29:46 +0100
commit81485a47d53e121ac3d8f27e225f7fa8fb7c3bf7 (patch)
tree158fc2b98c0b99176f9192e1f5a12c989e2fe0bc /meta/lib
parentc0149ac6c4859a05a7a1f7310a9bd981caea8f2d (diff)
downloadpoky-81485a47d53e121ac3d8f27e225f7fa8fb7c3bf7.tar.gz
classes/buildhistory: record PKG/PKGE/PKGV/PKGR
Save PKG (the actual output package name, which is often different due to debian renaming), and PKGE/PKGV/PKGR (which may be manipulated in certain special cases e.g. gitpkgv.bbclass in meta-oe, the external-sourcery-toolchain recipe, etc.) Note that these are only written when they are different from the normal package name in the case of PKG, or PE/PV/PR for the other variables. Also, use PKGE/PKGV/PKGR instead of PE/PV/PR when comparing package versions since these actually represent the version that the package manager sees. Implements [YOCTO #2787]. (From OE-Core rev: 65d7e9b2d4d8115ac9fd513c04f39a2df9556a5a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-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