buildhistory_analysis: hide version number increases in dependencies
If an item in RDEPENDS or RRECOMMENDS only increases in its version number then don't report it as a change, since we don't care about it. This significantly reduces the noise after upgrades. (From OE-Core rev: f72b2a1bda35a99292063c1cc6ff563b397e190d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
0b8a693fb4
commit
9d8e5ab47a
|
@ -55,8 +55,7 @@ class ChangeRecord:
|
|||
else:
|
||||
prefix = ''
|
||||
|
||||
def pkglist_split(pkgs):
|
||||
depver = bb.utils.explode_dep_versions(pkgs)
|
||||
def pkglist_combine(depver):
|
||||
pkglist = []
|
||||
for k,v in depver.iteritems():
|
||||
if v:
|
||||
|
@ -67,8 +66,9 @@ class ChangeRecord:
|
|||
|
||||
if self.fieldname in list_fields or self.fieldname in list_order_fields:
|
||||
if self.fieldname in ['RDEPENDS', 'RRECOMMENDS']:
|
||||
aitems = pkglist_split(self.oldvalue)
|
||||
bitems = pkglist_split(self.newvalue)
|
||||
(depvera, depverb) = compare_pkg_lists(self.oldvalue, self.newvalue)
|
||||
aitems = pkglist_combine(depvera)
|
||||
bitems = pkglist_combine(depverb)
|
||||
else:
|
||||
aitems = self.oldvalue.split()
|
||||
bitems = self.newvalue.split()
|
||||
|
@ -239,6 +239,45 @@ def compare_lists(alines, blines):
|
|||
return filechanges
|
||||
|
||||
|
||||
def split_version(s):
|
||||
"""Split a version string into its constituent parts (PE, PV, PR)
|
||||
FIXME: this is a duplicate of a new function in bitbake/lib/bb/utils -
|
||||
we should switch to that once we can bump the minimum bitbake version
|
||||
"""
|
||||
s = s.strip(" <>=")
|
||||
e = 0
|
||||
if s.count(':'):
|
||||
e = int(s.split(":")[0])
|
||||
s = s.split(":")[1]
|
||||
r = ""
|
||||
if s.count('-'):
|
||||
r = s.rsplit("-", 1)[1]
|
||||
s = s.rsplit("-", 1)[0]
|
||||
v = s
|
||||
return (e, v, r)
|
||||
|
||||
|
||||
def compare_pkg_lists(astr, bstr):
|
||||
depvera = bb.utils.explode_dep_versions(astr)
|
||||
depverb = bb.utils.explode_dep_versions(bstr)
|
||||
|
||||
# Strip out changes where the version has increased
|
||||
remove = []
|
||||
for k in depvera:
|
||||
if k in depverb:
|
||||
dva = depvera[k]
|
||||
dvb = depverb[k]
|
||||
if dva != dvb:
|
||||
if bb.utils.vercmp(split_version(dva), split_version(dvb)) < 0:
|
||||
remove.append(k)
|
||||
|
||||
for k in remove:
|
||||
depvera.pop(k)
|
||||
depverb.pop(k)
|
||||
|
||||
return (depvera, depverb)
|
||||
|
||||
|
||||
def compare_dict_blobs(path, ablob, bblob, report_all):
|
||||
adict = blob_to_dict(ablob)
|
||||
bdict = blob_to_dict(bblob)
|
||||
|
@ -259,6 +298,10 @@ def compare_dict_blobs(path, ablob, bblob, report_all):
|
|||
if percentchg < monitor_numeric_threshold:
|
||||
continue
|
||||
elif (not report_all) and key in list_fields:
|
||||
if key in ['RDEPENDS', 'RRECOMMENDS']:
|
||||
(depvera, depverb) = compare_pkg_lists(astr, bstr)
|
||||
if depvera == depverb:
|
||||
continue
|
||||
alist = astr.split()
|
||||
alist.sort()
|
||||
blist = bstr.split()
|
||||
|
|
Loading…
Reference in New Issue