Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] Do not try to source stray directories in bashrc paths
Date: Sat, 29 Nov 2014 19:45:46
Message-Id: 547A2264.7060709@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] Do not try to source stray directories in bashrc paths by "Michał Górny"
1 On 11/29/2014 11:26 AM, Michał Górny wrote:
2 > Check whether a particular bashrc path is not a directory before trying
3 > to source it. Avoids unnecessary 'is a directory' errors.
4 > ---
5 > bin/ebuild.sh | 2 +-
6 > 1 file changed, 1 insertion(+), 1 deletion(-)
7 >
8 > diff --git a/bin/ebuild.sh b/bin/ebuild.sh
9 > index 658884a..0de51f7 100755
10 > --- a/bin/ebuild.sh
11 > +++ b/bin/ebuild.sh
12 > @@ -421,7 +421,7 @@ __try_source() {
13 > qa=false
14 > shift
15 > fi
16 > - if [[ -r "$1" ]]; then
17 > + if [[ -r $1 && -f $1 ]]; then
18 > local debug_on=false
19 > if [[ "$PORTAGE_DEBUG" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then
20 > debug_on=true
21 >
22
23 LGTM.
24 --
25 Thanks,
26 Zac