Gentoo Archives: gentoo-portage-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-portage-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-portage-dev] [PATCH] Do not try to source stray directories in bashrc paths
Date: Sat, 29 Nov 2014 11:30:17
Message-Id: 1417260603-26312-1-git-send-email-mgorny@gentoo.org
1 Check whether a particular bashrc path is not a directory before trying
2 to source it. Avoids unnecessary 'is a directory' errors.
3 ---
4 bin/ebuild.sh | 2 +-
5 1 file changed, 1 insertion(+), 1 deletion(-)
6
7 diff --git a/bin/ebuild.sh b/bin/ebuild.sh
8 index 658884a..46c3a03 100755
9 --- a/bin/ebuild.sh
10 +++ b/bin/ebuild.sh
11 @@ -421,7 +421,7 @@ __try_source() {
12 qa=false
13 shift
14 fi
15 - if [[ -r "$1" ]]; then
16 + if [[ -r $1 && ! -d $1 ]]; then
17 local debug_on=false
18 if [[ "$PORTAGE_DEBUG" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then
19 debug_on=true
20 --
21 2.1.3

Replies