summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorAnuj Mittal <anuj.mittal@intel.com>2018-03-05 16:07:58 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-08 10:39:32 -0800
commitba9d8c5a39ff1ac4ab083f93d721cda2087c6650 (patch)
tree4364a1090c61d5a22478bd6d0c91d4ccfa15d2f2 /meta
parent551cb1f373417606c4fa6890eda469dec690d105 (diff)
downloadpoky-ba9d8c5a39ff1ac4ab083f93d721cda2087c6650.tar.gz
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>
Diffstat (limited to 'meta')
-rw-r--r--meta/lib/oe/buildhistory_analysis.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/meta/lib/oe/buildhistory_analysis.py b/meta/lib/oe/buildhistory_analysis.py
index 6c0bca8d05..bf2a9d30e8 100644
--- a/meta/lib/oe/buildhistory_analysis.py
+++ b/meta/lib/oe/buildhistory_analysis.py
@@ -36,7 +36,6 @@ related_fields = {}
36related_fields['RDEPENDS'] = ['DEPENDS'] 36related_fields['RDEPENDS'] = ['DEPENDS']
37related_fields['RRECOMMENDS'] = ['DEPENDS'] 37related_fields['RRECOMMENDS'] = ['DEPENDS']
38related_fields['FILELIST'] = ['FILES'] 38related_fields['FILELIST'] = ['FILES']
39related_fields['PKGSIZE'] = ['FILELIST']
40related_fields['files-in-image.txt'] = ['installed-package-names.txt', 'USER_CLASSES', 'IMAGE_CLASSES', 'ROOTFS_POSTPROCESS_COMMAND', 'IMAGE_POSTPROCESS_COMMAND'] 39related_fields['files-in-image.txt'] = ['installed-package-names.txt', 'USER_CLASSES', 'IMAGE_CLASSES', 'ROOTFS_POSTPROCESS_COMMAND', 'IMAGE_POSTPROCESS_COMMAND']
41related_fields['installed-package-names.txt'] = ['IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'NO_RECOMMENDATIONS', 'PACKAGE_EXCLUDE'] 40related_fields['installed-package-names.txt'] = ['IMAGE_FEATURES', 'IMAGE_LINGUAS', 'IMAGE_INSTALL', 'BAD_RECOMMENDATIONS', 'NO_RECOMMENDATIONS', 'PACKAGE_EXCLUDE']
42 41
@@ -99,7 +98,17 @@ class ChangeRecord:
99 for name in adirs - bdirs] 98 for name in adirs - bdirs]
100 files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) \ 99 files_ba = [(name, sorted(os.path.basename(item) for item in bitems if os.path.dirname(item) == name)) \
101 for name in bdirs - adirs] 100 for name in bdirs - adirs]
102 renamed_dirs = [(dir1, dir2) for dir1, files1 in files_ab for dir2, files2 in files_ba if files1 == files2] 101 renamed_dirs = []
102 for dir1, files1 in files_ab:
103 rename = False
104 for dir2, files2 in files_ba:
105 if files1 == files2 and not rename:
106 renamed_dirs.append((dir1,dir2))
107 # Make sure that we don't use this (dir, files) pair again.
108 files_ba.remove((dir2,files2))
109 # If a dir has already been found to have a rename, stop and go no further.
110 rename = True
111
103 # remove files that belong to renamed dirs from aitems and bitems 112 # remove files that belong to renamed dirs from aitems and bitems
104 for dir1, dir2 in renamed_dirs: 113 for dir1, dir2 in renamed_dirs:
105 aitems = [item for item in aitems if os.path.dirname(item) not in (dir1, dir2)] 114 aitems = [item for item in aitems if os.path.dirname(item) not in (dir1, dir2)]