mirror of
https://git.yoctoproject.org/poky
synced 2026-05-31 00:39:46 +00:00
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>
This commit is contained in:
committed by
Richard Purdie
parent
c0149ac6c4
commit
81485a47d5
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user