summaryrefslogtreecommitdiff
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:28:03 +0100
commit65d7e9b2d4d8115ac9fd513c04f39a2df9556a5a (patch)
treeb11dd80827cf2e7f7c496c14abaa579d79548a55 /meta/lib
parent988a417c857c01c87de6ba9602968059cf8d830f (diff)
downloadopenembedded-core-65d7e9b2d4d8115ac9fd513c04f39a2df9556a5a.tar.gz
openembedded-core-65d7e9b2d4d8115ac9fd513c04f39a2df9556a5a.tar.bz2
openembedded-core-65d7e9b2d4d8115ac9fd513c04f39a2df9556a5a.zip
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]. 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
# How to display fields
list_fields = ['DEPENDS', 'RDEPENDS', 'RRECOMMENDS', 'FILES', 'FILELIST', 'USER_CLASSES', 'IMAGE_CLASSES', 'IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS']
list_order_fields = ['PACKAGES']
+defaultval_fields = ['PKG', 'PKGE', 'PKGV', 'PKGR']
numeric_fields = ['PKGSIZE', 'IMAGESIZE']
# Fields to monitor
-monitor_fields = ['RDEPENDS', 'RRECOMMENDS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE']
+monitor_fields = ['RDEPENDS', 'RRECOMMENDS', 'PACKAGES', 'FILELIST', 'PKGSIZE', 'IMAGESIZE', 'PKG', 'PKGE', 'PKGV', 'PKGR']
# Percentage change to alert for numeric fields
monitor_numeric_threshold = 20
# Image files to monitor (note that image-info.txt is handled separately)
@@ -90,6 +91,10 @@ class ChangeRecord:
else:
percentchg = 100
out = '%s changed from %s to %s (%s%d%%)' % (self.fieldname, self.oldvalue or "''", self.newvalue or "''", '+' if percentchg > 0 else '', percentchg)
+ elif self.fieldname in defaultval_fields:
+ out = '%s changed from %s to %s' % (self.fieldname, self.oldvalue, self.newvalue)
+ if self.fieldname == 'PKG' and '[default]' in self.newvalue:
+ out += ' - may indicate debian renaming failure'
elif self.fieldname in ['pkg_preinst', 'pkg_postinst', 'pkg_prerm', 'pkg_postrm']:
if self.oldvalue and self.newvalue:
out = '%s changed:\n ' % self.fieldname
@@ -299,6 +304,14 @@ def compare_dict_blobs(path, ablob, bblob, report_all):
adict = blob_to_dict(ablob)
bdict = blob_to_dict(bblob)
+ defaultvals = {}
+ defaultvals['PKG'] = os.path.basename(path)
+ defaultvals['PKGE'] = adict.get('PE', '0')
+ defaultvals['PKGV'] = adict.get('PV', '')
+ defaultvals['PKGR'] = adict.get('PR', '')
+ for key in defaultvals:
+ defaultvals[key] = '%s [default]' % defaultvals[key]
+
changes = []
keys = list(set(adict.keys()) | set(bdict.keys()))
for key in keys:
@@ -327,6 +340,13 @@ def compare_dict_blobs(path, ablob, bblob, report_all):
blist.sort()
if ' '.join(alist) == ' '.join(blist):
continue
+
+ if key in defaultval_fields:
+ if not astr:
+ astr = defaultvals[key]
+ elif not bstr:
+ bstr = defaultvals[key]
+
chg = ChangeRecord(path, key, astr, bstr, key in monitor_fields)
changes.append(chg)
return changes