public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Davide Pesavento <pesa@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements.
Date: Mon, 30 Nov 2015 18:33:13 +0100	[thread overview]
Message-ID: <CADfzvvZiXfR5SENfxnHPgffKpCoR5Z-Hv23ExaoBN1S2yjgr6w@mail.gmail.com> (raw)
In-Reply-To: <22107.62027.57796.708914@a1i15.kph.uni-mainz.de>

On Mon, Nov 30, 2015 at 7:52 AM, Ulrich Mueller <ulm@gentoo.org> wrote:
>>>>>> On Mon, 30 Nov 2015, Davide Pesavento wrote:
>
>>> The patch below replaces them by case statements. (Unfortunately we
>>> cannot use fall-through (&;) because it is a bash 4 feature.)
>
>> Sounds reasonable, although I'd find an 'if' clause slightly more
>> readable, since there wouldn't be an 'else' branch in 2 out of 3
>> cases.
>
> It is slightly more complicated to match multiple patterns with [[ ]]
> because it requires multiple conditions, regexps, or extglob. We could
> of course use a bracket expression like [[ ${EAPI:-0} = [012345] ]]
> but I find it ugly in this context (and it won't be able to check for
> EAPI 10 ;) ).

Yeah I had a bracket expression in mind... which I find less ugly than
a case/esac in this context. And I agree with mgorny that the EAPI=10
argument is kinda moot. Anyway, this is really not important, feel
free to ignore my comment.

Thanks,
Davide


  parent reply	other threads:[~2015-11-30 17:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29 13:29 [gentoo-dev] eutils.eclass: further cleanup for EAPI 6 Ulrich Mueller
2015-11-29 13:29 ` [gentoo-dev] [PATCH 1/2] eutils.eclass: Disable epatch_user in " Ulrich Müller
2015-11-29 13:31 ` [gentoo-dev] [PATCH 2/2] eutils.eclass: Move all deprecated functions to the end Ulrich Müller
2015-11-29 16:48 ` [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements Ulrich Mueller
2015-11-29 23:29   ` Davide Pesavento
2015-11-30  6:52     ` Ulrich Mueller
2015-11-30  9:47       ` Michał Górny
2015-11-30 17:33       ` Davide Pesavento [this message]
2015-12-01 13:50       ` [gentoo-dev] " Duncan

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=CADfzvvZiXfR5SENfxnHPgffKpCoR5Z-Hv23ExaoBN1S2yjgr6w@mail.gmail.com \
    --to=pesa@gentoo.org \
    --cc=gentoo-dev@lists.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