[OE-core] [PATCH] buildhistory_analysis: ignore ownership for sysroot diffs

Ross Burton ross.burton at intel.com
Thu Jul 4 10:36:42 UTC 2019


The sysroot isn't populated under pseudo, so ownership differences should be ignored.

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/lib/oe/buildhistory_analysis.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index 8af76c6b3a3..708e1b388e2 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -282,7 +282,7 @@ def file_list_to_dict(lines):
     return adict
 
 
-def compare_file_lists(alines, blines):
+def compare_file_lists(alines, blines, compare_ownership=True):
     adict = file_list_to_dict(alines)
     bdict = file_list_to_dict(blines)
     filechanges = []
@@ -294,16 +294,20 @@ def compare_file_lists(alines, blines):
             newvalue = newsplitv[0][0]
             if oldvalue != newvalue:
                 filechanges.append(FileChange(path, FileChange.changetype_type, oldvalue, newvalue))
+
             # Check permissions
             oldvalue = splitv[0][1:]
             newvalue = newsplitv[0][1:]
             if oldvalue != newvalue:
                 filechanges.append(FileChange(path, FileChange.changetype_perms, oldvalue, newvalue))
-            # Check owner/group
-            oldvalue = '%s/%s' % (splitv[1], splitv[2])
-            newvalue = '%s/%s' % (newsplitv[1], newsplitv[2])
-            if oldvalue != newvalue:
-                filechanges.append(FileChange(path, FileChange.changetype_ownergroup, oldvalue, newvalue))
+
+            if compare_ownership:
+                # Check owner/group
+                oldvalue = '%s/%s' % (splitv[1], splitv[2])
+                newvalue = '%s/%s' % (newsplitv[1], newsplitv[2])
+                if oldvalue != newvalue:
+                    filechanges.append(FileChange(path, FileChange.changetype_ownergroup, oldvalue, newvalue))
+
             # Check symlink target
             if newsplitv[0][0] == 'l':
                 if len(splitv) > 3:
@@ -574,7 +578,7 @@ def process_changes(repopath, revision1, revision2='HEAD', report_all=False, rep
             elif filename == 'sysroot':
                 alines = d.a_blob.data_stream.read().decode('utf-8').splitlines()
                 blines = d.b_blob.data_stream.read().decode('utf-8').splitlines()
-                filechanges = compare_file_lists(alines,blines)
+                filechanges = compare_file_lists(alines,blines, compare_ownership=False)
                 if filechanges:
                     chg = ChangeRecord(path, filename, None, None, True)
                     chg.filechanges = filechanges
-- 
2.11.0



More information about the Openembedded-core mailing list