From: Davide Pesavento <pesa@gentoo.org>
To: "Michał Górny" <mgorny@gentoo.org>
Cc: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] RFC: using array variables in qt4-r2.eclass
Date: Sun, 15 Jul 2012 18:15:51 +0200 [thread overview]
Message-ID: <CADfzvvYxSuuR-AWLbPogZP0jc0s-v2pO-0G1HRmLeLgwgG4F+w@mail.gmail.com> (raw)
In-Reply-To: <20120715175336.0df6d073@pomiocik.lan>
On Sun, Jul 15, 2012 at 5:53 PM, Michał Górny <mgorny@gentoo.org> wrote:
> On Sun, 15 Jul 2012 17:36:05 +0200
> Davide Pesavento <pesa@gentoo.org> wrote:
>
>> On Sun, Jul 15, 2012 at 3:42 PM, Michał Górny <mgorny@gentoo.org>
>> wrote:
>> > On Sun, 15 Jul 2012 13:00:47 +0200
>> > Davide Pesavento <pesa@gentoo.org> wrote:
>> >
>> >> On Sat, Jul 14, 2012 at 4:00 PM, Michał Górny <mgorny@gentoo.org>
>> >> wrote:
>> >> > On Sat, 14 Jul 2012 12:29:59 +0200
>> >> > Davide Pesavento <pesa@gentoo.org> wrote:
>> >> >
>> >> >> On Fri, Jul 13, 2012 at 3:50 PM, Alexis Ballier
>> >> >> <aballier@gentoo.org> wrote:
>> >> >> > On Fri, 13 Jul 2012 15:26:58 +0200
>> >> >> > Davide Pesavento <pesa@gentoo.org> wrote:
>> >> >> >
>> >> >> >> > [...]
>> >> >> >> >> + # backward compatibility for non-array variables
>> >> >> >> >> + if [[ -n ${DOCS} ]] && [[ "$(declare -p DOCS
>> >> >> >> >> 2>/dev/null
>> >> >> >> >> 2>&1)" != "declare -a"* ]]; then
>> >> >> >> >> + dodoc ${DOCS} || die "dodoc failed"
>> >> >> >> >> + fi
>> >> >> >> >> + if [[ -n ${HTML_DOCS} ]] && [[ "$(declare -p
>> >> >> >> >> HTML_DOCS
>> >> >> >> >> 2>/dev/null 2>&1)" != "declare -a"* ]]; then
>> >> >> >> >> + dohtml -r ${HTML_DOCS} || die "dohtml
>> >> >> >> >> failed"
>> >> >> >> >> + fi
>> >> >> >> >> }
>> >> >> >> >
>> >> >> >> > maybe issue an eqawarn in that case telling people to
>> >> >> >> > convert to arrays; some time later make this an ewarn
>> >> >> >> > telling non-array support will be removed and again later
>> >> >> >> > make this a die :) (if you take that route i would expect
>> >> >> >> > you to start converting packages to use arrays)
>> >> >> >> >
>> >> >> >>
>> >> >> >> We have no intention of deprecating non-array variables in
>> >> >> >> qt4-r2 eclass.
>> >> >> >
>> >> >> > why ? having two codepaths for the same thing, one being
>> >> >> > inferior, sounds like a good reason to deprecate the inferior
>> >> >> > one :)
>> >> >> >
>> >> >> > A.
>> >> >> >
>> >> >>
>> >> >> Maintaining these two codepaths has practically zero cost, while
>> >> >> forcing every ebuild using qt4-r2 to switch to arrays would
>> >> >> waste developers' time which is better spent elsewhere.
>> >> >>
>> >> >> Furthermore, the non-array variant is not necessarily inferior,
>> >> >> because it allows you to use bash globbing, brace expansion,
>> >> >> etc...
>> >> >
>> >> > And arrays stopped to allow that overnight?
>> >> >
>> >>
>> >> I mean that the following won't work as you might expect:
>> >>
>> >> DOCS=("*.txt")
>> >
>> > I doubt anyone would expect quoted string to be evaluated as glob.
>> >
>>
>> It depends on when the expansion is performed, although in the
>> base.eclass case, DOCS=(*.txt) doesn't work either, because the
>> quoting happens inside the eclass function.
>>
>> Anyway, I was just explaining why I argued that "the non-array variant
>> is not necessarily inferior". Using DOCS="*.txt" is actually a
>> supported use case and a valid reason not to deprecate non-array
>> variables.
>
> So, you're saying that you're going to support two different variants
> of the variable which work two different ways?
>
Basically yes. As yngwin said, we're introducing support for array
variables to be more in line with other eclasses. People do expect
DOCS to be an array variable, and I've already been asked a few times
for this kind of support.
Thanks,
Pesa
prev parent reply other threads:[~2012-07-15 16:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-13 12:02 [gentoo-dev] RFC: using array variables in qt4-r2.eclass Ben de Groot
2012-07-13 12:34 ` Alexis Ballier
2012-07-13 13:26 ` Davide Pesavento
2012-07-13 13:50 ` Alexis Ballier
2012-07-14 10:29 ` Davide Pesavento
2012-07-14 14:00 ` Michał Górny
2012-07-15 11:00 ` Davide Pesavento
2012-07-15 13:42 ` Michał Górny
2012-07-15 15:36 ` Davide Pesavento
2012-07-15 15:53 ` Michał Górny
2012-07-15 16:15 ` Davide Pesavento [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CADfzvvYxSuuR-AWLbPogZP0jc0s-v2pO-0G1HRmLeLgwgG4F+w@mail.gmail.com \
--to=pesa@gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
--cc=mgorny@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox