Skip to contentSkip to conversation

buildhistory-diff: reduce PKGR noise

PATCH New Ed Bartosh 1 participant 1 message Jul 8, 2016

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

PATCH 1/1 buildhistory-diff: reduce PKGR noise

When using PR service the buildhistory-diff output contains a lot of PKGR changes: In practice the mass of PKGR updates hide other important changes as they often account for 80% of all changes.

Skipped incremental and decremental changes of PKGR versions to reduce amount of the script output. All changes are still included in the output if script is run with -a/--report-all command line option.

[YOCTO #9755]

---
 meta/lib/oe/buildhistory_analysis.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
meta/lib/oe/buildhistory_analysis.py +18 -0
index 4353381..b6c0265 100644
@@ -359,6 +359,24 @@ def compare_dict_blobs(path, ablob, bblob, report_all, report_ver):
                 if ' '.join(alist) == ' '.join(blist):
                     continue
 
+            if key == 'PKGR' and not report_all:
+                vers = []
+                # strip leading 'r' and dots
+                for ver in (astr.split()[0], bstr.split()[0]):
+                    if ver.startswith('r'):
+                        ver = ver[1:]
+                    vers.append(ver.replace('.', ''))
+                maxlen = max(len(vers[0]), len(vers[1]))
+                try:
+                    # pad with '0' and convert to int
+                    vers = [int(ver.ljust(maxlen, '0')) for ver in vers]
+                except ValueError:
+                    pass
+                else:
+                     # skip decrements and increments
+                    if abs(vers[0] - vers[1]) == 1:
+                        continue
+
             chg = ChangeRecord(path, key, astr, bstr, monitored)
             changes.append(chg)
     return changes
Signature · 1 line
2.1.4