Gentoo Archives: gentoo-dev

From: Michael Orlitzky <mjo@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [PATCH] git-r3.eclass: Make EGIT_LIVE_* associative arrays
Date: Thu, 23 Jun 2016 02:56:59
Message-Id: 576B4FEA.8000507@gentoo.org
In Reply to: Re: [gentoo-dev] [PATCH] git-r3.eclass: Make EGIT_LIVE_* associative arrays by Dan Douglas
1 On 06/22/2016 08:34 PM, Dan Douglas wrote:
2 > On 06/22/2016 07:12 PM, Ulrich Mueller wrote:
3 >>>>>>> On Wed, 22 Jun 2016, Dan Douglas wrote:
4 >>
5 >>> + [[
6 >>> + ( BASH_VERSINFO[0] -ge 4 || EAPI -ge 6 ) &&
7 >>> + $(declare -p "EGIT_${livevars[idx+1]}" 2>/dev/null) == 'declare -A'*
8 >>> + ]] && ref=EGIT_${livevars[idx+1]}[\$PN]
9 >>
10 >> EAPI is not a number but a string, so don't use arithmetic comparison
11 >> to test for it
12 >
13 > You mean in the future it may have non-digit values that pass the
14 > `case $EAPI in ...)` at the top?
15
16 Yeah, it would be perfectly legal to name the next EAPI "seven" and add
17 it to the case statement at the top. Then [[ "seven" -ge 6 ]] is false.

Replies

Subject Author
Re: [gentoo-dev] [PATCH] git-r3.eclass: Make EGIT_LIVE_* associative arrays Dan Douglas <ormaaj@×××××.com>