Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-dev
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-dev@g.o
From: "Walter Dnes" <waltdnes@...>
Subject: Re: RFD: EAPI specification in ebuilds
Date: Thu, 8 Mar 2012 19:50:51 -0500
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
#  <call routine for processing EAPI 0>
   exit
elif [ ${counter} -gt 1 ]; then
   echo "***ERROR*** only 1 line allowed beginning with EAPI="
   exit
else
#  <parse value of EAPI and call appropriate ebuild parser version>
   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 <waltdnes@...>


References:
RFD: EAPI specification in ebuilds
-- Ulrich Mueller
Navigation:
Lists: gentoo-dev: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
Re: RFD: EAPI specification in ebuilds
Next by thread:
Re: RFD: EAPI specification in ebuilds
Previous by date:
Re: RFD: EAPI specification in ebuilds
Next by date:
Re: RFD: EAPI specification in ebuilds


Updated Jun 29, 2012

Summary: Archive of the gentoo-dev mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.