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 A57561384B4 for ; Mon, 30 Nov 2015 06:53:10 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 1E05F21C05F; Mon, 30 Nov 2015 06:53:03 +0000 (UTC) Received: from a1www.kph.uni-mainz.de (a1www.kph.uni-mainz.de [134.93.134.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 0FD0521C052 for ; Mon, 30 Nov 2015 06:53:01 +0000 (UTC) Received: from a1i15.kph.uni-mainz.de (a1i15.kph.uni-mainz.de [134.93.134.92]) by a1www.kph.uni-mainz.de (8.14.9/8.14.7) with ESMTP id tAU6qxJ6015871 for ; Mon, 30 Nov 2015 07:52:59 +0100 Received: from a1i15.kph.uni-mainz.de (localhost [127.0.0.1]) by a1i15.kph.uni-mainz.de (8.14.8/8.14.2) with ESMTP id tAU6qxGm003807; Mon, 30 Nov 2015 07:52:59 +0100 Received: (from ulm@localhost) by a1i15.kph.uni-mainz.de (8.14.8/8.14.8/Submit) id tAU6qxDC003802; Mon, 30 Nov 2015 07:52:59 +0100 Message-ID: <22107.62027.57796.708914@a1i15.kph.uni-mainz.de> Date: Mon, 30 Nov 2015 07:52:59 +0100 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] [PATCH] eutils.eclass: In EAPI conditionals, replace "has" by case statements. In-Reply-To: References: <22106.64938.215501.17191@a1i15.kph.uni-mainz.de> <22107.11375.846871.672757@a1i15.kph.uni-mainz.de> X-Mailer: VM 8.2.0b under 24.3.1 (x86_64-pc-linux-gnu) From: Ulrich Mueller 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-Type: multipart/signed; boundary="pgp+signed+xQRPUZB5VGCouTp"; micalg=pgp-sha256; protocol="application/pgp-signature" X-Archives-Salt: 7d05ced1-dcc9-42d8-8cd4-62db59c63576 X-Archives-Hash: f2f9d07c0b11527cf54fd402ee592c30 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --pgp+signed+xQRPUZB5VGCouTp Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit >>>>> 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 ;) ). Besides, case seems to be the command most used for EAPI checking in eclasses. Ulrich --pgp+signed+xQRPUZB5VGCouTp Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQEcBAEBCAAGBQJWW/I9AAoJEMMJBoUcYcJz/WEIAL7tLMxKYBrJc+EsvJZ1cOee gPwufPiymRs/DmPE5LWeR6Doo7ALXfz2yBzDceQUSZNh7BdpyNwKixOjFrujIDCo iKYJZ/dJDAuuo2DdEYiL/tsEKVlcY+aYjVwMRdBARAfTo0V9zFwe6M3xoUsfh/TU GslgS4b0oURsF0NMzCiqYusc8z44HIDCWPo8ZUdNFWCkrNxz2XmbZMWKDrpqkQ1G o7Q36NAOs74ePRn6YQ5VkWxMJVY6/gQYRdzUkTig8KzFQ5T2nsWoyP+s1uIXxVem ZNSaS1gtEKwKoyiuhV5OOGqcbU4J8iX+9zob72dYP/Xln5jZ/5n1kveYk0gLAXQ= =NuHF -----END PGP SIGNATURE----- --pgp+signed+xQRPUZB5VGCouTp--