Gentoo Archives: gentoo-dev

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

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass Davide Pesavento <pesa@g.o>