mirror of
https://git.yoctoproject.org/poky
synced 2026-01-29 21:08:42 +01:00
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] (From OE-Core rev: cff000c43d6e9a183911338951026dfbef88f838) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
551cb1f373
commit
ba9d8c5a39
@@ -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']
|
||||
related_fields['installed-package-names.txt'] = ['IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'NO_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
|
||||
|
||||
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user