From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 17F3E138CEB for ; Wed, 17 Jun 2015 06:55:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8DB51E07D0; Wed, 17 Jun 2015 06:55:53 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 300CFE07D0 for ; Wed, 17 Jun 2015 06:55:53 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 1B4D63408EA for ; Wed, 17 Jun 2015 06:55:52 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 06D009EE for ; Wed, 17 Jun 2015 06:55:50 +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: <1434524076.f5cdbf6af191c857b2c13455cb4d2d7b844c05f4.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/_emerge/ X-VCS-Repository: proj/portage X-VCS-Files: pym/_emerge/main.py X-VCS-Directories: pym/_emerge/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: f5cdbf6af191c857b2c13455cb4d2d7b844c05f4 X-VCS-Branch: master Date: Wed, 17 Jun 2015 06:55:50 +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: fe514901-f163-4428-b33a-bf71053d7d2f X-Archives-Hash: 098affce4d6fd2a036e84f2f7f4d9d69 commit: f5cdbf6af191c857b2c13455cb4d2d7b844c05f4 Author: Zac Medico gentoo org> AuthorDate: Wed Jun 17 05:21:05 2015 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jun 17 06:54:36 2015 +0000 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=f5cdbf6a Redirect /dev/fd bash test to /dev/null (bug 552340) The /dev/fd test from commit 7fab3aadb4cdca35ce0d81525af1256c745308ff shows a bash error message unecessarily. Fixes: 7fab3aadb4cd ("Add another check for broken /dev/s (bug 538980)") X-Gentoo-Bug: 552340 X-Gentoo-Bug-url: https://bugs.gentoo.org/show_bug.cgi?id=552340 Acked-by: Alexander Berntsen gentoo.org> pym/_emerge/main.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/pym/_emerge/main.py b/pym/_emerge/main.py index a5dafa3..b69aa24 100644 --- a/pym/_emerge/main.py +++ b/pym/_emerge/main.py @@ -1126,12 +1126,19 @@ def emerge_main(args=None): # Verify that BASH process substitution works as another cheap early # filter. Process substitution uses '/dev/fd'. - if portage.process.spawn_bash("[[ $(< <(echo foo) ) == foo ]]") != 0: - writemsg_level("Failed to validate a sane '/dev'.\n" - "bash process substitution doesn't work; this may be an " - "indication of a broken '/dev/fd'.\n", - level=logging.ERROR, noiselevel=-1) - return 1 + with open(os.devnull, 'r+b') as dev_null: + fd_pipes = { + 0: dev_null.fileno(), + 1: dev_null.fileno(), + 2: dev_null.fileno(), + } + if portage.process.spawn_bash("[[ $(< <(echo foo) ) == foo ]]", + fd_pipes=fd_pipes) != 0: + writemsg_level("Failed to validate a sane '/dev'.\n" + "bash process substitution doesn't work; this may be an " + "indication of a broken '/dev/fd'.\n", + level=logging.ERROR, noiselevel=-1) + return 1 # Portage needs to ensure a sane umask for the files it creates. os.umask(0o22)