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 15:54:23
Message-Id: 20120715175336.0df6d073@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 17:36:05 +0200
2 Davide Pesavento <pesa@g.o> wrote:
3
4 > On Sun, Jul 15, 2012 at 3:42 PM, Michał Górny <mgorny@g.o>
5 > wrote:
6 > > On Sun, 15 Jul 2012 13:00:47 +0200
7 > > Davide Pesavento <pesa@g.o> wrote:
8 > >
9 > >> On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@g.o>
10 > >> wrote:
11 > >> > On Sat, 14 Jul 2012 12:29:59 +0200
12 > >> > Davide Pesavento <pesa@g.o> wrote:
13 > >> >
14 > >> >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier
15 > >> >> <aballier@g.o> wrote:
16 > >> >> > On Fri, 13 Jul 2012 15:26:58 +0200
17 > >> >> > Davide Pesavento <pesa@g.o> wrote:
18 > >> >> >
19 > >> >> >> > [...]
20 > >> >> >> >> + # backward compatibility for non-array variables
21 > >> >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS
22 > >> >> >> >> 2>/dev/null
23 > >> >> >> >> 2>&1)" != "declare -a"* ]]; then
24 > >> >> >> >> + dodoc ${DOCS} || die "dodoc failed"
25 > >> >> >> >> + fi
26 > >> >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p
27 > >> >> >> >> HTML_DOCS
28 > >> >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then
29 > >> >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml
30 > >> >> >> >> failed"
31 > >> >> >> >> + fi
32 > >> >> >> >> }
33 > >> >> >> >
34 > >> >> >> > maybe issue an eqawarn in that case telling people to
35 > >> >> >> > convert to arrays; some time later make this an ewarn
36 > >> >> >> > telling non-array support will be removed and again later
37 > >> >> >> > make this a die :) (if you take that route i would expect
38 > >> >> >> > you to start converting packages to use arrays)
39 > >> >> >> >
40 > >> >> >>
41 > >> >> >> We have no intention of deprecating non-array variables in
42 > >> >> >> qt4-r2 eclass.
43 > >> >> >
44 > >> >> > why ? having two codepaths for the same thing, one being
45 > >> >> > inferior, sounds like a good reason to deprecate the inferior
46 > >> >> > one :)
47 > >> >> >
48 > >> >> > A.
49 > >> >> >
50 > >> >>
51 > >> >> Maintaining these two codepaths has practically zero cost, while
52 > >> >> forcing every ebuild using qt4-r2 to switch to arrays would
53 > >> >> waste developers' time which is better spent elsewhere.
54 > >> >>
55 > >> >> Furthermore, the non-array variant is not necessarily inferior,
56 > >> >> because it allows you to use bash globbing, brace expansion,
57 > >> >> etc...
58 > >> >
59 > >> > And arrays stopped to allow that overnight?
60 > >> >
61 > >>
62 > >> I mean that the following won't work as you might expect:
63 > >>
64 > >> DOCS=("*.txt")
65 > >
66 > > I doubt anyone would expect quoted string to be evaluated as glob.
67 > >
68 >
69 > It depends on when the expansion is performed, although in the
70 > base.eclass case, DOCS=(*.txt) doesn't work either, because the
71 > quoting happens inside the eclass function.
72 >
73 > Anyway, I was just explaining why I argued that "the non-array variant
74 > is not necessarily inferior". Using DOCS="*.txt" is actually a
75 > supported use case and a valid reason not to deprecate non-array
76 > variables.
77
78 So, you're saying that you're going to support two different variants
79 of the variable which work two different ways?
80
81 --
82 Best regards,
83 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>