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 1S5o4J-000871-Dz for garchives@archives.gentoo.org; Fri, 09 Mar 2012 00:52:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 324A0E0764; Fri, 9 Mar 2012 00:52:14 +0000 (UTC) Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 2C02DE05DD for ; Fri, 9 Mar 2012 00:51:16 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AokGAKU/KE9FpZz+/2dsb2JhbACBX48mjVV5iHCeGYYZBIZQjX6GS4QL X-IronPort-AV: E=Sophos;i="4.73,1,1325480400"; d="scan'208";a="166858811" Received: from 69-165-156-254.dsl.teksavvy.com (HELO waltdnes.org) ([69.165.156.254]) by ironport2-out.teksavvy.com with SMTP; 08 Mar 2012 19:51:14 -0500 Received: by waltdnes.org (sSMTP sendmail emulation); Thu, 08 Mar 2012 19:50:51 -0500 From: "Walter Dnes" Date: Thu, 8 Mar 2012 19:50:51 -0500 To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] RFD: EAPI specification in ebuilds Message-ID: <20120309005051.GA18449@waltdnes.org> References: <20311.51166.725757.212932@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-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20311.51166.725757.212932@a1i15.kph.uni-mainz.de> User-Agent: Mutt/1.5.21 (2010-09-15) X-Archives-Salt: bc0c1870-a2c1-4d73-8053-f82140ee772c X-Archives-Hash: e0b1f6d145eda91d49cc78c3963b6aa2 On Wed, Mar 07, 2012 at 09:41:02PM +0100, Ulrich Mueller wrote > Written in a more formal way, appropriate for a specification: > - Ebuilds must contain at most one EAPI assignment statement. > - It must occur within the first N lines of the ebuild (N=10 and N=30 > have been suggested). > - The statement must match the following regular expression (extended > regexp syntax): > ^[ \t]*EAPI=(['"]?)([A-Za-z0-9._+-]*)\1[ \t]*(#.*)?$ > > Note: The first and the third point are already fulfilled by all > ebuilds in the Portage tree. The second point will require very few > ebuilds to be changed (9 packages for N=10, or 2 packages for N=30). The second point could be rendered moot with a little sanity checking like so... #!/bin/bash counter=`grep -c "^EAPI=" ${1}` if [ ${counter} -eq 0 ]; then # exit elif [ ${counter} -gt 1 ]; then echo "***ERROR*** only 1 line allowed beginning with EAPI=" exit else # exit fi This treats the EAPI statement as a declaration, and doesn't care where it shows up in the file. I'm assuming no leading blanks in front of "EAPI". -- Walter Dnes