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 F3ABA1389E2 for ; Sat, 29 Nov 2014 19:45:46 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6EB94E08AB; Sat, 29 Nov 2014 19:45:46 +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 ED596E08A2 for ; Sat, 29 Nov 2014 19:45:45 +0000 (UTC) Received: from [192.168.1.4] (ip70-181-96-121.oc.oc.cox.net [70.181.96.121]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 337BF33FAAE; Sat, 29 Nov 2014 19:45:45 +0000 (UTC) Message-ID: <547A2264.7060709@gentoo.org> Date: Sat, 29 Nov 2014 11:45:40 -0800 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 To: gentoo-portage-dev@lists.gentoo.org CC: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Subject: Re: [gentoo-portage-dev] [PATCH] Do not try to source stray directories in bashrc paths References: <5479E6F9.1050802@gentoo.org> <1417289193-5402-1-git-send-email-mgorny@gentoo.org> In-Reply-To: <1417289193-5402-1-git-send-email-mgorny@gentoo.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 303a697b-bc29-42bd-8ba7-a9f36bff8ffc X-Archives-Hash: 951210a29016ce51233e9afb839443ba On 11/29/2014 11:26 AM, Michał Górny wrote: > Check whether a particular bashrc path is not a directory before trying > to source it. Avoids unnecessary 'is a directory' errors. > --- > bin/ebuild.sh | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/bin/ebuild.sh b/bin/ebuild.sh > index 658884a..0de51f7 100755 > --- a/bin/ebuild.sh > +++ b/bin/ebuild.sh > @@ -421,7 +421,7 @@ __try_source() { > qa=false > shift > fi > - if [[ -r "$1" ]]; then > + if [[ -r $1 && -f $1 ]]; then > local debug_on=false > if [[ "$PORTAGE_DEBUG" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then > debug_on=true > LGTM. -- Thanks, Zac