]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/buildhistory_analysis: Avoid tracebacks from file comparision code
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 29 Oct 2020 15:21:35 +0000 (15:21 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Oct 2020 12:37:53 +0000 (12:37 +0000)
We're seeing tracebacks from buildhistory analysing the python 3.8 -> 3.9
upgrade due to the significant file renames. Avoid these by checking before
removal as they can happen multiple times.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/buildhistory_analysis.py

index 2d6fa1779e817208055dcedc28d8c39e65630f6c..b1856846b6a2389e6b4cc7313a43421eebd8e352 100644 (file)
@@ -373,8 +373,10 @@ def compare_file_lists(alines, blines, compare_ownership=True):
                                 removals.remove(removal2)
                     continue
             filechanges.append(FileChange(removal, FileChange.changetype_move, addition))
-            additions.remove(addition)
-            removals.remove(removal)
+            if addition in additions:
+                additions.remove(addition)
+            if removal in removals:
+                removals.remove(removal)
     for rename in renames:
         filechanges.append(FileChange(renames[rename], FileChange.changetype_move, rename))