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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6328D1396D0 for ; Wed, 4 Oct 2017 07:09:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CA35E2BC066; Wed, 4 Oct 2017 07:09:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id AB65C2BC066 for ; Wed, 4 Oct 2017 07:09:34 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 9C9AF341757 for ; Wed, 4 Oct 2017 07:09:33 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id C21AB9085 for ; Wed, 4 Oct 2017 07:09:31 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1507100852.26c0a0e31b5150f7ef23b2156b87863e47dd5996.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/BinpkgExtractorAsync.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 26c0a0e31b5150f7ef23b2156b87863e47dd5996 X-VCS-Branch: master Date: Wed, 4 Oct 2017 07:09:31 +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-Archives-Salt: 92036140-b539-473a-ad1c-df10b88bbf66 X-Archives-Hash: a6bb6687990b9f8cfcebbf7a69a8748f commit: 26c0a0e31b5150f7ef23b2156b87863e47dd5996 Author: Zac Medico gentoo org> AuthorDate: Wed Oct 4 06:07:05 2017 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Oct 4 07:07:32 2017 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=26c0a0e3 BinpkgExtractorAsync: fix PIPESTATUS error handling Fixes: b4b0e6b0aaa1 ("remove trailer when decompressing binary packages") pym/_emerge/BinpkgExtractorAsync.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/pym/_emerge/BinpkgExtractorAsync.py b/pym/_emerge/BinpkgExtractorAsync.py index 173845974..07ba2a1b7 100644 --- a/pym/_emerge/BinpkgExtractorAsync.py +++ b/pym/_emerge/BinpkgExtractorAsync.py @@ -80,17 +80,21 @@ class BinpkgExtractorAsync(SpawnProcess): # SIGPIPE handling (128 + SIGPIPE) should be compatible with # assert_sigpipe_ok() that's used by the ebuild unpack() helper. self.args = [self._shell_binary, "-c", - ("head -c-%d -- %s | %s | tar -xp %s -C %s -f - ; " + \ - "p=(${PIPESTATUS[@]}) ; " + \ - "if [[ ${p[0]} != 0 && ${p[0]} != %d ]] ; then " % (128 + signal.SIGPIPE) + \ - "echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \ - "if [ ${p[1]} != 0 ] ; then " + \ - "echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \ + ("cmd0=(head -c-%d -- %s) cmd1=(%s) cmd2=(tar -xp %s -C %s -f -); " + \ + '"${cmd0[@]}" | "${cmd1[@]}" | "${cmd2[@]}"; ' + \ + "p=(${PIPESTATUS[@]}) ; for i in {0..2}; do " + \ + "if [[ ${p[$i]} != 0 && ${p[$i]} != %d ]] ; then " + \ + "echo command $(eval \"echo \\\"'\\${cmd$i[*]}'\\\"\") " + \ + "failed with status ${p[$i]} ; exit ${p[$i]} ; fi ; done; " + \ + "if [ ${p[$i]} != 0 ] ; then " + \ + "echo command $(eval \"echo \\\"'\\${cmd$i[*]}'\\\"\") " + \ + "failed with status ${p[$i]} ; exit ${p[$i]} ; fi ; " + \ "exit 0 ;") % \ (pkg_xpak.xpaksize, portage._shell_quote(self.pkg_path), decomp_cmd, tar_options, - portage._shell_quote(self.image_dir))] + portage._shell_quote(self.image_dir), + 128 + signal.SIGPIPE)] SpawnProcess._start(self)