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] __eapi6_src_prepare: Silence 'declare -p PATCHES' errors
Date: Sat, 14 Nov 2015 22:03:41
Message-Id: 5647AFA9.3080905@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] __eapi6_src_prepare: Silence 'declare -p PATCHES' errors by "Michał Górny"
1 On 11/14/2015 01:46 PM, Michał Górny wrote:
2 > Silence the error message when PATCHES array is not declared.
3 > ---
4 > bin/phase-helpers.sh | 2 +-
5 > 1 file changed, 1 insertion(+), 1 deletion(-)
6 >
7 > diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
8 > index 3e619dc..6c45c25 100644
9 > --- a/bin/phase-helpers.sh
10 > +++ b/bin/phase-helpers.sh
11 > @@ -805,7 +805,7 @@ __eapi4_src_install() {
12 > }
13 >
14 > __eapi6_src_prepare() {
15 > - if [[ $(declare -p PATCHES) == "declare -a"* ]]; then
16 > + if [[ $(declare -p PATCHES 2>/dev/null) == "declare -a"* ]]; then
17 > eapply "${PATCHES[@]}"
18 > elif [[ -n ${PATCHES} ]]; then
19 > eapply ${PATCHES}
20 >
21
22 Looks good.
23 --
24 Thanks,
25 Zac