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 448B3158020 for ; Wed, 2 Nov 2022 22:58:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6A328E09BD; Wed, 2 Nov 2022 22:58: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 4F8F3E09BD for ; Wed, 2 Nov 2022 22:58: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)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 54A95340FC4 for ; Wed, 2 Nov 2022 22:58:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BF79955B for ; Wed, 2 Nov 2022 22:58:53 +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: <1667429929.b9e30bb50996c11f2b046a9c6eb47ba8dc6331e6.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: b9e30bb50996c11f2b046a9c6eb47ba8dc6331e6 X-VCS-Branch: master Date: Wed, 2 Nov 2022 22:58:53 +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: ce9cb9d1-2095-4d84-9ee2-eedb6d947f23 X-Archives-Hash: 04fd6452385092af3158d2f8f8c7ca39 commit: b9e30bb50996c11f2b046a9c6eb47ba8dc6331e6 Author: Sheng Yu protonmail com> AuthorDate: Wed Nov 2 17:52:18 2022 +0000 Commit: Sam James gentoo org> CommitDate: Wed Nov 2 22:58:49 2022 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=b9e30bb5 Do not redirect stderr from gpkg subprocess Closes: https://bugs.gentoo.org/877215 Signed-off-by: Sheng Yu protonmail.com> Closes: https://github.com/gentoo/portage/pull/927 Signed-off-by: Sam James gentoo.org> lib/portage/gpkg.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/lib/portage/gpkg.py b/lib/portage/gpkg.py index 3d2aa4223..561fa4450 100644 --- a/lib/portage/gpkg.py +++ b/lib/portage/gpkg.py @@ -92,6 +92,7 @@ class tar_stream_writer: gid # drop root group to gid """ self.checksum_helper = checksum_helper + self.cmd = cmd self.closed = False self.container = container self.killed = False @@ -124,7 +125,6 @@ class tar_stream_writer: cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, user=self.uid, group=self.gid, ) @@ -133,7 +133,6 @@ class tar_stream_writer: cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, preexec_fn=self._drop_privileges, ) @@ -195,10 +194,10 @@ class tar_stream_writer: buffer = self.proc.stdout.read(HASHING_BLOCKSIZE) if not buffer: self.proc.stdout.close() - self.proc.stderr.close() return except BrokenPipeError: self.proc.stdout.close() + writemsg(colorize("BAD", f"GPKG subprocess failed: {self.cmd} \n")) if not self.killed: # Do not raise error if killed by portage raise CompressorOperationFailed("PIPE broken") @@ -220,6 +219,7 @@ class tar_stream_writer: self.proc.stdin.write(data) except BrokenPipeError: self.error = True + writemsg(colorize("BAD", f"GPKG subprocess failed: {self.cmd} \n")) raise CompressorOperationFailed("PIPE broken") else: # Write to container @@ -319,7 +319,6 @@ class tar_stream_reader: cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, user=self.uid, group=self.gid, ) @@ -328,7 +327,6 @@ class tar_stream_reader: cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE, preexec_fn=self._drop_privileges, ) self.read_io = self.proc.stdout @@ -374,6 +372,7 @@ class tar_stream_reader: break except BrokenPipeError: if self.killed is False: + writemsg(colorize("BAD", f"GPKG subprocess failed: {self.cmd} \n")) raise CompressorOperationFailed("PIPE broken") def _drop_privileges(self): @@ -431,14 +430,11 @@ class tar_stream_reader: self.thread.join() try: if self.proc.wait() != os.EX_OK: - if not self.proc.stderr.closed: - stderr = self.proc.stderr.read().decode() if not self.killed: - writemsg(colorize("BAD", f"!!!\n{stderr}")) + writemsg(colorize("BAD", f"GPKG external program failed.")) raise CompressorOperationFailed("decompression failed") finally: self.proc.stdout.close() - self.proc.stderr.close() class checksum_helper: