From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 60991138334 for ; Wed, 18 Dec 2019 11:08:55 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D627CE08EC; Wed, 18 Dec 2019 11:08:34 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5CFCEE08CD for ; Wed, 18 Dec 2019 11:08:34 +0000 (UTC) Received: from a1i15 (a1i15.kph.uni-mainz.de [134.93.134.92]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: ulm) by smtp.gentoo.org (Postfix) with ESMTPSA id F08F634D9E7 for ; Wed, 18 Dec 2019 11:08:32 +0000 (UTC) From: Ulrich =?utf-8?Q?M=C3=BCller?= To: Subject: [gentoo-dev] [PATCH 1/3] elisp-common.eclass: Allow full versions in elisp-need-emacs(). In-Reply-To: References: Message-Id: <1af855e066c3024b9a021dc38211070944867486.1576663643.git.ulm@gentoo.org> Date: Wed, 18 Dec 2019 12:08:29 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) 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 X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Archives-Salt: 6d83ed5a-5431-4ec7-9118-5d4b1cdb58ca X-Archives-Hash: 04ab83f1bc300352dea07c8934b7d9bb --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To this end, replace the simple numeric comparison of the first component by a call to ver_test. Signed-off-by: Ulrich M=C3=BCller =2D-- eclass/elisp-common.eclass | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass index 79f29ef95ad..6f79caee2f0 100644 =2D-- a/eclass/elisp-common.eclass +++ b/eclass/elisp-common.eclass @@ -158,7 +158,8 @@ # merge and unmerge of a package. =20 case ${EAPI:-0} in =2D 4|5|6|7) ;; + 4|5|6) inherit eapi7-ver ;; + 7) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac =20 @@ -230,11 +231,16 @@ elisp-need-emacs() { have_emacs=3D$(elisp-emacs-version) || return 2 einfo "Emacs version: ${have_emacs}" if [[ ${have_emacs} =3D~ XEmacs|Lucid ]]; then =2D eerror "This package needs GNU Emacs." + eerror "XEmacs detected. This package needs GNU Emacs." return 1 fi =2D if ! [[ ${have_emacs%%.*} -ge ${need_emacs%%.*} ]]; then =2D eerror "This package needs at least Emacs ${need_emacs%%.*}." + # GNU Emacs versions have only numeric components. + if ! [[ ${have_emacs} =3D~ ^[0-9]+(\.[0-9]+)*$ ]]; then + eerror "Malformed version string: ${have_emacs}" + return 2 + fi + if ! ver_test "${have_emacs}" -ge "${need_emacs}"; then + eerror "This package needs at least Emacs ${need_emacs}." eerror "Use \"eselect emacs\" to select the active version." return 1 fi =2D-=20 2.24.1 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEZlHkP3TnuTbxrN0HwwkGhRxhwnMFAl36CK0ACgkQwwkGhRxh wnM4XQgArF6VYNpM2PT06O0VymUHuesptKqujC+UTuwVNbYXy7mbLWpZhTnfhyif wrPBcm0XffzLl+yOxQRC4gkPBOJ1j1oO7CnGHB9sJb26y0NIC1QH43xuchMG47aD aWYx9HLq/rkGD3ej7iy3QFJE0aqN3h59a+8HMeSG9tgQlD1saQMg+wyZCsuhdpEG oSUGZF7OyYDDA2aeEO1Di04WOPdEC/3UvqQ34XYnDKrBW+JMoqroHy/aaXAFOw+n iIkDgISlMVl0ZM7r9pMDvMDFKWI5JvaG7ctDC2BhBRwE6FgackFqCu6IT8qbuzVZ hgVwiqyJA4xl925/UBKIHzKwhG5LrQ== =7CCM -----END PGP SIGNATURE----- --=-=-=--