[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    Re: [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements.
From:       Davide Pesavento <pesa () gentoo ! org>
Date:       2015-11-30 17:33:13
Message-ID: CADfzvvZiXfR5SENfxnHPgffKpCoR5Z-Hv23ExaoBN1S2yjgr6w () mail ! gmail ! com
[Download RAW message or body]

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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic