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 1RYnd8-0005t0-UG for garchives@archives.gentoo.org; Thu, 08 Dec 2011 23:43:59 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0A4A521C0C2; Thu, 8 Dec 2011 23:43:49 +0000 (UTC) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) by pigeon.gentoo.org (Postfix) with ESMTP id 518F721C0BC for ; Thu, 8 Dec 2011 23:42:54 +0000 (UTC) Received: by bkat8 with SMTP id t8so2628278bka.40 for ; Thu, 08 Dec 2011 15:42:54 -0800 (PST) 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 Received: by 10.180.105.232 with SMTP id gp8mr8172948wib.65.1323387774275; Thu, 08 Dec 2011 15:42:54 -0800 (PST) Sender: antarus@scriptkitty.com Received: by 10.227.206.197 with HTTP; Thu, 8 Dec 2011 15:42:54 -0800 (PST) In-Reply-To: <201112081724.09591.vapier@gentoo.org> References: <201112081724.09591.vapier@gentoo.org> Date: Thu, 8 Dec 2011 15:42:54 -0800 X-Google-Sender-Auth: Mc3ZW00US5tVl7MOPG1Bx-kh_CY Message-ID: Subject: Re: [gentoo-dev] multiple inclusion protection with eclasses From: Alec Warner To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 831bd01a-64d2-4685-8de3-aae2b8fde438 X-Archives-Hash: a4c65fa39c2054b9b05c29384957a19a On Thu, Dec 8, 2011 at 2:24 PM, Mike Frysinger wrote: > ferringb did some tests and found that doing multiple inclusion protectio= n in > eclasses gets us some nice speed ups. =C2=A0it isn't nearly as nice as if= we had a > way of skipping the `source` altogether, but that that would require PMS/= tree > changes. =C2=A0the change i'm proposing can be implemented $now and shoul= d work > with all versions. =C2=A0PMS extensions can thus be discussed in parallel= . > > simply put, it's the same thing as doing standard #ifdef logic in headers= to > protect against multiple inclusion errors. =C2=A0on to the example: > > --- autotools.eclass > +++ autotools.eclass > @@ -10,6 +10,9 @@ > =C2=A0# This eclass is for safely handling autotooled software packages t= hat need > =C2=A0# regenerate their build scripts. =C2=A0All functions will abort in= case of > > +if [[ ${___ECLASS_ONCE_AUTOTOOLS} !=3D "recur -_+^+_- spank" ]] ; then > +___ECLASS_ONCE_AUTOTOOLS=3D"recur -_+^+_- spank" > + Not to rain on your parade; but is that the value you are sticking with? -A > =C2=A0inherit eutils libtool > > =C2=A0# @ECLASS-VARIABLE: WANT_AUTOCONF > @@ -399,3 +402,5 @@ > > =C2=A0 =C2=A0 =C2=A0 =C2=A0echo $include_opts > =C2=A0} > + > +fi > > this assumes that the eclass in question isn't doing something weird. =C2= =A0for > example, if you had an ebuild today that did: > =C2=A0 =C2=A0 =C2=A0 =C2=A0inherit eutils > =C2=A0 =C2=A0 =C2=A0 =C2=A0epatch() { die erp; } > =C2=A0 =C2=A0 =C2=A0 =C2=A0inherit eutils > > that local epatch() would get reset by the eutils inherit. =C2=A0but i ca= n't see > any ebuild having a valid reason for doing things like this, so screw 'em= . > > i plan on implementing this in the eclasses i generally look over. =C2=A0= i don't > plan on doing it for all eclasses since i'm not familiar with them. > -mike