diff options
authorAnuj Mittal <>2018-03-05 16:07:58 +0800
committerRichard Purdie <>2018-03-08 10:31:58 -0800
commitcff000c43d6e9a183911338951026dfbef88f838 (patch)
parent02416e0d007c6c0f8c01a1e1fe0485b21087ec00 (diff)
buildhistory: remove duplicate renames
In cases when a package like qemu might have files with same names in multiple directories, the rename logic might go wrong and create multiple rename pair for a single directory. Make sure that we process each rename pair once. Also, don't print FILELIST as part of PKGSIZE to ensure that it gets printed only once when reporting package changes. Fixes [YOCTO #12559] Signed-off-by: Anuj Mittal <> Signed-off-by: Ross Burton <>
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oe/ b/meta/lib/oe/
index 6c0bca8d05..bf2a9d30e8 100644
--- a/meta/lib/oe/
+++ b/meta/lib/oe/
@@ -36,7 +36,6 @@ related_fields = {}
related_fields['RDEPENDS'] = ['DEPENDS']
related_fields['RRECOMMENDS'] = ['DEPENDS']
related_fields['FILELIST'] = ['FILES']
-related_fields['PKGSIZE'] = ['FILELIST']
related_fields['files-in-image.txt'] = ['installed-package-names.txt', 'USER_CLASSES', 'IMAGE_CLASSES', 'ROOTFS_POSTPROCESS_COMMAND', 'IMAGE_POSTPROCESS_COMMAND']
@@ -99,7 +98,17 @@ class ChangeRecord:
for name in adirs - bdirs]
files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) \
for name in bdirs - adirs]
- renamed_dirs = [(dir1, dir2) for dir1, files1 in files_ab for dir2, files2 in files_ba if files1 == files2]
+ renamed_dirs = []
+ for dir1, files1 in files_ab:
+ rename = False
+ for dir2, files2 in files_ba:
+ if files1 == files2 and not rename:
+ renamed_dirs.append((dir1,dir2))
+ # Make sure that we don't use this (dir, files) pair again.
+ files_ba.remove((dir2,files2))
+ # If a dir has already been found to have a rename, stop and go no further.
+ rename = True
# remove files that belong to renamed dirs from aitems and bitems
for dir1, dir2 in renamed_dirs:
aitems = [item for item in aitems if os.path.dirname(item) not in (dir1, dir2)]