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 19:26:42 | ||
Message-Id: | 1417289193-5402-1-git-send-email-mgorny@gentoo.org | ||
In Reply to: | Re: [gentoo-portage-dev] [PATCH] Do not try to source stray directories in bashrc paths by Zac Medico |
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..0de51f7 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 && -f $1 ]]; then |
17 | local debug_on=false |
18 | if [[ "$PORTAGE_DEBUG" == "1" ]] && [[ "${-/x/}" == "$-" ]]; then |
19 | debug_on=true |
20 | -- |
21 | 2.1.3 |
Subject | Author |
---|---|
Re: [gentoo-portage-dev] [PATCH] Do not try to source stray directories in bashrc paths | Zac Medico <zmedico@g.o> |