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 88C3515808B for ; Mon, 11 Apr 2022 12:11:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E1832E0936; Mon, 11 Apr 2022 12:11:56 +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) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 50B46E093D for ; Mon, 11 Apr 2022 12:11:56 +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 8FDBE340FBB for ; Mon, 11 Apr 2022 12:11:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id DC6D2D0 for ; Mon, 11 Apr 2022 12:11:52 +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: <1649679065.51df6a3a490c46bcb40939be0691f59e2edbbd7b.floppym@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/ X-VCS-Repository: proj/portage X-VCS-Files: lib/portage/dispatch_conf.py X-VCS-Directories: lib/portage/ X-VCS-Committer: floppym X-VCS-Committer-Name: Mike Gilbert X-VCS-Revision: 51df6a3a490c46bcb40939be0691f59e2edbbd7b X-VCS-Branch: master Date: Mon, 11 Apr 2022 12:11:52 +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: 798f40ac-46c0-43b7-a192-33de80f47e24 X-Archives-Hash: d9a7a4f858877716754bc15b33170ca0 commit: 51df6a3a490c46bcb40939be0691f59e2edbbd7b Author: Mike Gilbert gentoo org> AuthorDate: Sun Apr 10 14:29:09 2022 +0000 Commit: Mike Gilbert gentoo org> CommitDate: Mon Apr 11 12:11:05 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=51df6a3a Revert "dispatch_conf: fix arguments" This is a step in the wrong direction, and causes another failure. Reverts: 94dad3d64599f7e2c0c28e90ec4bee883746e385. Bug: https://bugs.gentoo.org/836447 Bug: https://bugs.gentoo.org/837656 Signed-off-by: Mike Gilbert gentoo.org> lib/portage/dispatch_conf.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/portage/dispatch_conf.py b/lib/portage/dispatch_conf.py index fc130c9af..6dbb1885e 100644 --- a/lib/portage/dispatch_conf.py +++ b/lib/portage/dispatch_conf.py @@ -28,15 +28,14 @@ RCS_GET = "co" _ARCHIVE_ROTATE_MAX = 9 -def diffstatusoutput(file1, file2): +def diffstatusoutput(cmd, file1, file2): """ Execute the string cmd in a shell with getstatusoutput() and return a 2-tuple (status, output). """ # Use Popen to emulate getstatusoutput(), since getstatusoutput() may # raise a UnicodeDecodeError which makes the output inaccessible. - cmd = f"diff -aq '{file1}' '{file2}'" - args = shlex_split(cmd) + args = shlex_split(cmd % (file1, file2)) args = (portage._unicode_encode(x, errors="strict") for x in args) proc = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) @@ -341,7 +340,7 @@ def file_archive(archive, curconf, newconf, mrgconf): # Archive the current config file if it isn't already saved if ( os.path.lexists(archive) - and len(diffstatusoutput_mixed(curconf, archive)[1]) != 0 + and len(diffstatusoutput_mixed(f"diff -aq '{curconf}' '{archive}'")[1]) != 0 ): _file_archive_rotate(archive)