From 088a391487f9c09e57c5ee2ccad9e530f1865c5e Mon Sep 17 00:00:00 2001 From: Michael Maltsev <4129781+m417z@users.noreply.github.com> Date: Thu, 17 Oct 2024 13:24:37 +0300 Subject: [PATCH] Temp exception for incorrect VirusTotal data --- data/upd05_group_by_filename.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/data/upd05_group_by_filename.py b/data/upd05_group_by_filename.py index 90a4526f45de..67e0926cdf96 100644 --- a/data/upd05_group_by_filename.py +++ b/data/upd05_group_by_filename.py @@ -204,6 +204,39 @@ def update_file_info(existing_file_info, new_file_info, new_file_info_source): if new_file_info is None: return existing_file_info + # temp { + sha256 = new_file_info.get('sha256') + if sha256 in [ + 'ee388bb290811423f8c437e4a09a78749ce6314bf1decbba08fe3c0ed8bcafa2', + ]: + assert sha256 == existing_file_info['sha256'] + if new_file_info == existing_file_info: + return existing_file_info + + assert 'version' not in existing_file_info + assert 'description' not in existing_file_info + + existing_file_info_enriched = existing_file_info.copy() + if 'version' in new_file_info: + existing_file_info_enriched['version'] = new_file_info['version'] + if 'description' in new_file_info: + existing_file_info_enriched['description'] = new_file_info['description'] + + if ( + existing_file_info_enriched.get('signingStatus') == 'Unsigned' + and new_file_info.get('signingStatus') == 'Signed' + and new_file_info.get('signatureType') == 'Catalog file' + ): + existing_file_info_enriched['signingStatus'] = 'Signed' + existing_file_info_enriched['signatureType'] = 'Catalog file' + + assert new_file_info == existing_file_info_enriched, ( + existing_file_info, + new_file_info, + ) + return new_file_info + # } + assert_file_info_close_enough(existing_file_info, new_file_info) if new_file_info_source == 'iso':