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 8D00A158094 for ; Tue, 5 Jul 2022 22:56:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 83CC1E0F7B; Tue, 5 Jul 2022 22:56:14 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 43E99E0F7B for ; Tue, 5 Jul 2022 22:56:13 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4F3F13415AA for ; Tue, 5 Jul 2022 22:56:12 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 78F434ED for ; Tue, 5 Jul 2022 22:56:10 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1657061765.1a25cc20a662d5dbcbaa18b4f10093f95428b1d3.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/gpkg.py X-VCS-Directories: lib/portage/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 1a25cc20a662d5dbcbaa18b4f10093f95428b1d3 X-VCS-Branch: master Date: Tue, 5 Jul 2022 22:56:10 +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: d7612c66-4f2e-449a-a612-376394e210f7 X-Archives-Hash: 796e403a1725f5f1640842d0e3d5a05d commit: 1a25cc20a662d5dbcbaa18b4f10093f95428b1d3 Author: Rin Cat (鈴猫) protonmail com> AuthorDate: Sun Jul 3 21:10:29 2022 +0000 Commit: Sam James gentoo org> CommitDate: Tue Jul 5 22:56:05 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=1a25cc20 Fix _check_pre_quickpkg_files image prefix Closes: https://bugs.gentoo.org/851276 Signed-off-by: Sheng Yu protonmail.com> Closes: https://github.com/gentoo/portage/pull/847 Signed-off-by: Sam James gentoo.org> lib/portage/gpkg.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py index fc111e44a..0622feb70 100644 --- a/lib/portage/gpkg.py +++ b/lib/portage/gpkg.py @@ -1847,11 +1847,12 @@ class gpkg: image_total_size, ) - def _check_pre_quickpkg_files(self, contents, root): + def _check_pre_quickpkg_files(self, contents, root, image_prefix="image"): """ Check the pre quickpkg files size and path, return the longest path length, largest single file size, and total files size. """ + image_prefix_length = len(image_prefix) + 1 root_dir = os.path.join( normalize_path( _unicode_decode(root, encoding=_encodings["fs"], errors="strict") @@ -1881,6 +1882,7 @@ class gpkg: prefix_length = ( len(_unicode_encode(d, encoding=_encodings["fs"], errors="strict")) - root_dir_length + + image_prefix_length ) image_max_prefix_length = max(image_max_prefix_length, prefix_length) @@ -1892,6 +1894,7 @@ class gpkg: path_length = ( len(_unicode_encode(path, encoding=_encodings["fs"], errors="strict")) - root_dir_length + + image_prefix_length ) file_stat = os.lstat(path)