Gentoo Archives: gentoo-dev

From: Davide Pesavento <pesa@g.o>
To: "Michał Górny" <mgorny@g.o>
Cc: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass
Date: Sun, 15 Jul 2012 11:01:47
Message-Id: CADfzvvYwrc8rR2A=8HBCMG3FZ2s7+7rUKupsoX7B=+L-t+fbtA@mail.gmail.com
In Reply to: Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass by "Michał Górny"
1 On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@g.o> wrote:
2 > On Sat, 14 Jul 2012 12:29:59 +0200
3 > Davide Pesavento <pesa@g.o> wrote:
4 >
5 >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier <aballier@g.o>
6 >> wrote:
7 >> > On Fri, 13 Jul 2012 15:26:58 +0200
8 >> > Davide Pesavento <pesa@g.o> wrote:
9 >> >
10 >> >> > [...]
11 >> >> >> + # backward compatibility for non-array variables
12 >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS 2>/dev/null
13 >> >> >> 2>&1)" != "declare -a"* ]]; then
14 >> >> >> + dodoc ${DOCS} || die "dodoc failed"
15 >> >> >> + fi
16 >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p HTML_DOCS
17 >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then
18 >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml failed"
19 >> >> >> + fi
20 >> >> >> }
21 >> >> >
22 >> >> > maybe issue an eqawarn in that case telling people to convert to
23 >> >> > arrays; some time later make this an ewarn telling non-array
24 >> >> > support will be removed and again later make this a die :)
25 >> >> > (if you take that route i would expect you to start converting
26 >> >> > packages to use arrays)
27 >> >> >
28 >> >>
29 >> >> We have no intention of deprecating non-array variables in qt4-r2
30 >> >> eclass.
31 >> >
32 >> > why ? having two codepaths for the same thing, one being inferior,
33 >> > sounds like a good reason to deprecate the inferior one :)
34 >> >
35 >> > A.
36 >> >
37 >>
38 >> Maintaining these two codepaths has practically zero cost, while
39 >> forcing every ebuild using qt4-r2 to switch to arrays would waste
40 >> developers' time which is better spent elsewhere.
41 >>
42 >> Furthermore, the non-array variant is not necessarily inferior,
43 >> because it allows you to use bash globbing, brace expansion, etc...
44 >
45 > And arrays stopped to allow that overnight?
46 >
47
48 I mean that the following won't work as you might expect:
49
50 DOCS=("*.txt")
51
52 Thanks,
53 Pesa

Replies

Subject Author
Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass "Michał Górny" <mgorny@g.o>