From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6665C158094 for ; Sun, 18 Sep 2022 18:30:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id AEFFDE07E6; Sun, 18 Sep 2022 18:30:43 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 94E80E07E6 for ; Sun, 18 Sep 2022 18:30:43 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B049C340C35 for ; Sun, 18 Sep 2022 18:30:42 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 30E79580 for ; Sun, 18 Sep 2022 18:30:41 +0000 (UTC) From: "Mike Gilbert" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Gilbert" Message-ID: <1663522207.62f35411d92d487339549a6ee1353ad3026c6579.floppym@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/checksum.py X-VCS-Directories: lib/portage/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 62f35411d92d487339549a6ee1353ad3026c6579 X-VCS-Branch: master Date: Sun, 18 Sep 2022 18:30:41 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: bcc794be-d0b1-42ee-803d-06b90c478e2e X-Archives-Hash: 85e813d875ce7e2c18f91d2e4329411d commit: 62f35411d92d487339549a6ee1353ad3026c6579 Author: Mike Gilbert gentoo org> AuthorDate: Sun Sep 18 15:01:31 2022 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Sun Sep 18 17:30:07 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=62f35411 Revert changes to portage.checksum._apply_hash_filter The modified code may discard the file size from the output, which is never desired. Also, it calls remove on the object being iterated over, which is problematic. Reverts: 18e5a8170c69aecd10f162918de571d85055ae81 Reported-by: Marek BehĂșn kernel.org> Signed-off-by: Mike Gilbert gentoo.org> lib/portage/checksum.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/portage/checksum.py b/lib/portage/checksum.py index 03a963a3e..85cc36af3 100644 --- a/lib/portage/checksum.py +++ b/lib/portage/checksum.py @@ -442,10 +442,10 @@ def _apply_hash_filter(digests, hash_filter): """ verifiable_hash_types = set(digests).intersection(hashfunc_keys) + verifiable_hash_types.discard("size") modified = False if len(verifiable_hash_types) > 1: - verifiable_hash_types.discard("size") - for k in verifiable_hash_types: + for k in list(verifiable_hash_types): if not hash_filter(k): modified = True verifiable_hash_types.remove(k) @@ -453,7 +453,11 @@ def _apply_hash_filter(digests, hash_filter): break if modified: - digests = {k: v for k, v in digests.items() if k in verifiable_hash_types} + digests = { + k: v + for k, v in digests.items() + if k == "size" or k in verifiable_hash_types + } return digests