When listing packages that have been added or removed from an image or
SDK, sort the list so that it's easier to read.

Signed-off-by: Ross Burton <[email protected]>
---
 meta/lib/oe/buildhistory_analysis.py | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/buildhistory_analysis.py 
b/meta/lib/oe/buildhistory_analysis.py
index 2c5f9c6b169..c1d502e89cf 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -13,6 +13,7 @@
 import sys
 import os.path
 import difflib
+import functools
 import git
 import re
 import shlex
@@ -206,6 +207,7 @@ class ChangeRecord:
 
         return '%s%s' % (prefix, out) if out else ''
 
[email protected]_ordering
 class FileChange:
     changetype_add = 'A'
     changetype_remove = 'R'
@@ -257,6 +259,12 @@ class FileChange:
         else:
             return '%s changed (unknown)' % self.path
 
+    def __eq__(self, other):
+        return (self.path, self.changetype, self.oldvalue, self.oldvalue) == 
(other.path, other.changetype, other.oldvalue, other.oldvalue)
+
+    def __lt__(self, other):
+        return (self.path, self.changetype, self.oldvalue, self.oldvalue) < 
(other.path, other.changetype, other.oldvalue, other.oldvalue)
+
 def blob_to_dict(blob):
     alines = [line for line in 
blob.data_stream.read().decode('utf-8').splitlines()]
     adict = {}
@@ -662,7 +670,7 @@ def process_changes(repopath, revision1, revision2='HEAD', 
report_all=False, rep
                     filechanges = compare_lists(alines,blines)
                     if filechanges:
                         chg = ChangeRecord(path, filename, None, None, True)
-                        chg.filechanges = filechanges
+                        chg.filechanges = sorted(filechanges)
                         changes.append(chg)
                 else:
                     chg = ChangeRecord(path, filename, 
d.a_blob.data_stream.read().decode('utf-8'), 
d.b_blob.data_stream.read().decode('utf-8'), True)
@@ -690,7 +698,7 @@ def process_changes(repopath, revision1, revision2='HEAD', 
report_all=False, rep
                     filechanges = compare_lists(alines,blines)
                     if filechanges:
                         chg = ChangeRecord(path, filename, None, None, True)
-                        chg.filechanges = filechanges
+                        chg.filechanges = sorted(filechanges)
                         changes.append(chg)
                 else:
                     chg = ChangeRecord(path, filename, 
d.a_blob.data_stream.read().decode('utf-8'), 
d.b_blob.data_stream.read().decode('utf-8'), True)
-- 
2.43.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#226059): 
https://lists.openembedded.org/g/openembedded-core/message/226059
Mute This Topic: https://lists.openembedded.org/mt/116172431/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to