From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1J4gBb-0008Vn-K1 for garchives@archives.gentoo.org; Tue, 18 Dec 2007 17:24:56 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.2/8.14.0) with SMTP id lBIHNx7l024257; Tue, 18 Dec 2007 17:23:59 GMT Received: from smtp.ferdyx.org (170.Red-213-96-222.staticIP.rima-tde.net [213.96.222.170]) by robin.gentoo.org (8.14.2/8.14.0) with ESMTP id lBIHLoa0021672 for ; Tue, 18 Dec 2007 17:21:52 GMT Received: from localhost (localhost [127.0.0.1]) by smtp.ferdyx.org (Postfix) with ESMTP id DFBA58D306 for ; Tue, 18 Dec 2007 18:25:05 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at ferdyx.org Received: from smtp.ferdyx.org ([127.0.0.1]) by localhost (tungsteno.ferdyx.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KV24epU8rcL6 for ; Tue, 18 Dec 2007 18:25:01 +0100 (CET) Received: from posidon.ferdyx.org (posidon.ferdyx.org [192.168.0.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.ferdyx.org (Postfix) with ESMTP id 72F898D305 for ; Tue, 18 Dec 2007 18:25:01 +0100 (CET) Received: by posidon.ferdyx.org (nbSMTP-1.01-cvs) for uid 1000 (using TLSv1/SSLv3 with cipher DHE-RSA-AES256-SHA (256/256 bits)) ferdy@gentoo.org; Tue, 18 Dec 2007 18:21:44 +0100 (CET) Date: Tue, 18 Dec 2007 18:21:43 +0100 From: "Fernando J. Pereda" To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Re: [GLEP] Use EAPI-suffixed ebuilds (.ebuild-EAPI) Message-ID: <20071218172143.GB4423@ferdyx.org> Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <200712172320.01988.peper@gentoo.org> <47671006.2020808@gentoo.org> <20071218001855.78c1864c@blueyonder.co.uk> <20071218013651.58f4f565@eusebe> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="V0207lvV8h4k8FAm" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Archives-Salt: c5e66b3b-a3d9-4e55-af77-0e113c2cce6c X-Archives-Hash: 9839fc87e7d620a164f806ef5bb8d701 --V0207lvV8h4k8FAm Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 18, 2007 at 05:05:13PM +0000, Steve Long wrote: > Thomas de Grenier de Latour wrote: >=20 > > On 2007/12/18, Ciaran McCreesh wrote: > >=20 > >> On Mon, 17 Dec 2007 17:10:46 -0700 > >> Joe Peterson wrote: > >> > I probably missed some of the stuff leading up to this GLEP, but > >> > what is the problem with having the EAPI in the file and > >> > determining it by looking at the file contents? > >>=20 > >> Motivation, second bullet point: > >>=20 > >> | Possibility to extend the behaviour of inherit and add new global > >> | scope functions (as a result of not sourcing ebuilds with > >> | unsupported EAPI). > >=20 > > Why can't it be in the file but readable without sourcing? For instance, > > it could be mandatory that EAPI=3DX, if present, must be the first > > non-blank and non-comment line of the ebuild (and it would then be > > checked after sourcing, if the ebuild is sourced, to bug on cases where > > it's redefined or unset afterwards). > > > There's _no_ need to source, nor constrain like that, for a simple one-li= ne > variable, eg:=20 > $ sed -nr '/^[[:space:]]*DESCRIPTION=3D"([^"]*)".*/ { s//\1/p;q; }' \ > app-portage/autounmask/autounmask-0.21.ebuild > autounmask - Unmasking packages the easy way >=20 > eapi=3D$(sed -nr '/^[[:space:]]*EAPI=3D"([^"]*)".*/ { s//\1/p;q; }' foo.e= build) > [[ $eapi ]] && checkAPI "$eapi" > ..would do it in bash (empty if unset in ebuild) assuming the conventional > EAPI=3D"xx" format is used. Other languages can call system() easily enou= gh. This is just *brillant*. Lets see how useful your solution is: --- 8< --- # EAPI has to be set differently based upon tests on PV if [[ -z ${PV/?.?/} ]] ; then EAPI=3D"bar-1" elif [[ -z ${PV/?.?.?/} ]] ; then EAPI=3D"0" else EAPI=3D"1" fi --- 8< --- So please, no hacks. - ferdy --=20 Fernando J. Pereda Garcimart=EDn 20BB BDC3 761A 4781 E6ED ED0B 0A48 5B0C 60BD 28D4 --V0207lvV8h4k8FAm Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHaAGnCkhbDGC9KNQRAtbcAJ9ZuqZBmX84rE62F1KXbEPbP29TqACgg2cc G80V8OxDKFALkhXwk+TnsRo= =Je/0 -----END PGP SIGNATURE----- --V0207lvV8h4k8FAm-- -- gentoo-dev@gentoo.org mailing list