From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1S78eB-0001Y0-IO for garchives@archives.gentoo.org; Mon, 12 Mar 2012 17:02:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D9DC3E0BFB; Mon, 12 Mar 2012 17:02:40 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CFA05E09DE for ; Mon, 12 Mar 2012 17:01:56 +0000 (UTC) Received: from [192.168.26.5] (ip98-164-193-252.oc.oc.cox.net [98.164.193.252]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: zmedico) by smtp.gentoo.org (Postfix) with ESMTPSA id 50EFC1B400A for ; Mon, 12 Mar 2012 17:01:56 +0000 (UTC) Message-ID: <4F5E2C02.6030802@gentoo.org> Date: Mon, 12 Mar 2012 10:01:54 -0700 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:10.0.1) Gecko/20120304 Thunderbird/10.0.1 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 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] RFD: EAPI specification in ebuilds References: <4F58FC55.7070005@orlitzky.com> <20120308184820.108fc30c@googlemail.com> <4F592612.6050203@orlitzky.com> <20120309060424.09cdce1e@pomiocik.lan> <4F599692.9050503@orlitzky.com> <20120309172921.281ee5a0@pomiocik.lan> <4F5A368D.2020605@orlitzky.com> <20314.14772.897891.110368@a1i15.kph.uni-mainz.de> <4F5A3E6C.4040900@orlitzky.com> <4F5A4246.8080605@gentoo.org> <20120312020344.GE7579@localhost> <4F5DA0FE.1070405@gentoo.org> <20120312092711.7dbd969f@pomiocik.lan> <20120312083019.3d38ffa0@googlemail.com> <20120312100904.55b1a577@pomiocik.lan> In-Reply-To: X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Archives-Salt: a294d31a-4c73-465e-b31f-8bb241d8dd01 X-Archives-Hash: 55112ec50d6ab9cfaa26526dc4e68e0a On 03/12/2012 02:16 AM, Kent Fredric wrote: > I just find a top-down regexp solution dangerously naive, as its > infering that the first line that matches the regexp *is* the EAPI > requirement field, when depending on the actual format used, that may > not be the case. > > If for example, a format is machine generated, and the EAPI > declaration accidentally comes after something that *isnt* an EAPI > declaration but by the regexp, LOOKS like one, then the probing > mechanism will resolve the WRONG value. > > And that doesn't strike me as being very resilient. It would be very fragile without the sanity check / feedback mechanism that's already been suggested [1]. The idea is to compare the probed EAPI with the result that's obtained from bash, and treat the ebuild as invalid if they are not identical. This would allow ebuilds that don't fit our EAPI probing mechanism to be immediately detected so that the ebuild developer could fix them. In practice, this will not be much of an issue, since the EAPI assignment will be required to be very close to the top of the file, and the package manager will stop searching as soon as it finds the first match. [1] https://bugs.gentoo.org/show_bug.cgi?id=402167#c18 -- Thanks, Zac