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 2AD4615810D for ; Tue, 23 May 2023 00:26:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 225E9E0963; Tue, 23 May 2023 00:26:24 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.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 04A12E0963 for ; Tue, 23 May 2023 00:26:24 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 05C7A335D6F for ; Tue, 23 May 2023 00:26:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 3A8A1A76 for ; Tue, 23 May 2023 00:26:21 +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: <1684801329.35b5e4d71ebb5c7408dba7dc27cff0c22cad1562.sam@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/dbapi/vartree.py X-VCS-Directories: lib/portage/dbapi/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: 35b5e4d71ebb5c7408dba7dc27cff0c22cad1562 X-VCS-Branch: master Date: Tue, 23 May 2023 00:26:21 +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: c75a5c1d-67c2-4f4d-8b42-f3cec84194ba X-Archives-Hash: 47bf987d867bc269da5a5d32ad209eb0 commit: 35b5e4d71ebb5c7408dba7dc27cff0c22cad1562 Author: gcarq protonmail com> AuthorDate: Mon Mar 27 13:31:44 2023 +0000 Commit: Sam James gentoo org> CommitDate: Tue May 23 00:22:09 2023 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=35b5e4d7 mergeme: Rely on mydmode instead of calling os.path.exists again Signed-off-by: gcarq protonmail.com> Signed-off-by: Sam James gentoo.org> lib/portage/dbapi/vartree.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py index 317cf327a..676d4aa05 100644 --- a/lib/portage/dbapi/vartree.py +++ b/lib/portage/dbapi/vartree.py @@ -5544,6 +5544,8 @@ class dblink: destmd5, mydest_link, ) + if protected and moveme: + mydmode = None zing = "!!!" if not moveme: @@ -5584,6 +5586,7 @@ class dblink: msg.append("") self._eerror("preinst", msg) mydest = newdest + mydmode = None # if secondhand is None it means we're operating in "force" mode and should not create a second hand. if (secondhand is not None) and (not os.path.exists(myrealto)): @@ -5797,6 +5800,7 @@ class dblink: msg.append("") self._eerror("preinst", msg) mydest = newdest + mydmode = None # whether config protection or not, we merge the new file the # same way. Unless moveme=0 (blocking directory) @@ -6260,10 +6264,7 @@ class dblink: Takes file mode and extended attributes into account. Should only be used for regular files. """ - if not os.path.exists(mydest): - return True - - if mymode != mydmode: + if mydmode is None or not stat.S_ISREG(mydmode) or mymode != mydmode: return True excluded_xattrs = self.settings.get("PORTAGE_XATTR_EXCLUDE", "")