From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 18F931384B4 for ; Mon, 30 Nov 2015 09:49:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E7B1E08E5; Mon, 30 Nov 2015 09:49:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4D20BE08D2 for ; Mon, 30 Nov 2015 09:49:30 +0000 (UTC) Received: from [10.207.115.241] (public-gprs516931.centertel.pl [31.61.138.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 3F5E3340649; Mon, 30 Nov 2015 09:49:26 +0000 (UTC) User-Agent: K-9 Mail for Android In-Reply-To: <22107.62027.57796.708914@a1i15.kph.uni-mainz.de> References: <22106.64938.215501.17191@a1i15.kph.uni-mainz.de> <22107.11375.846871.672757@a1i15.kph.uni-mainz.de> <22107.62027.57796.708914@a1i15.kph.uni-mainz.de> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements. From: =?UTF-8?Q?Micha=C5=82_G=C3=B3rny?= Date: Mon, 30 Nov 2015 10:47:02 +0100 To: gentoo-dev@lists.gentoo.org,Ulrich Mueller Message-ID: <238B92C4-6111-485A-A2C5-117E6EDD3A1C@gentoo.org> X-Archives-Salt: a2afd732-1f2d-45a9-877b-0d1723e7c858 X-Archives-Hash: 1d5346455f44c8d4d10d1e8a0e977cd4 , Dnia 30 listopada 2015 07:52:59 CET, Ulrich Mueller napisaƂ(a): >>>>>> 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 ;) ). Do you expect those functions to be restored in the eclass in EAPI 10? As I see it, it's moot argument. > >Besides, case seems to be the command most used for EAPI checking in >eclasses. Because usually it has three branches, not one or two. > >Ulrich -- Sent from my Android device with K-9 Mail. Please excuse my brevity.