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 1NeQhi-0005Od-OF for garchives@archives.gentoo.org; Mon, 08 Feb 2010 10:18:54 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9907EE0B73; Mon, 8 Feb 2010 10:18:48 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id CDBC9E0ADE for ; Mon, 8 Feb 2010 10:18:20 +0000 (UTC) Received: from [192.168.1.35] (unknown [77.246.104.171]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTP id 56A071B42B7 for ; Mon, 8 Feb 2010 10:18:19 +0000 (UTC) Subject: Re: [gentoo-dev] Calling unknown commands in an ebuild From: Peter Volkov To: gentoo-dev@lists.gentoo.org In-Reply-To: <201002072124.49047.vapier@gentoo.org> References: <1265577010.28554.15.camel@blackhole.cddr.org> <4B6F3C7F.700@gentoo.org> <201002072124.49047.vapier@gentoo.org> Content-Type: multipart/mixed; boundary="=-N6EcN54LcVXgc2y4E9I6" Date: Mon, 08 Feb 2010 13:18:03 +0300 Message-ID: <1265624283.5916.484.camel@tablet> 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 X-Mailer: Evolution 2.28.2 X-Archives-Salt: c7e9eba8-570b-46d0-81a1-4415040f0301 X-Archives-Hash: ceff7c397ef58b2bf5f8552cf9244e7b --=-N6EcN54LcVXgc2y4E9I6 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable =D0=92 =D0=92=D1=81=D0=BA, 07/02/2010 =D0=B2 21:24 -0500, Mike Frysinger = =D0=BF=D0=B8=D1=88=D0=B5=D1=82: > it might also be useful to add a default epatch() to the initial env th= at=20 > would be clobbered when the inherit occurred. > epatch() { die "you need to inherit eutils.eclass to use epatch" ; } After fixing breakage that was introduced by dropping inherit eutils from distutils.eclass I think we must have such thing. But one function just covers most common case while we need to cover all cases. What about pregenerating env file with script like in attachment? $ awk -f generate-die-eclass-env /usr/portage/eclass/*.eclass I guess it's possible to generate such env file on server side and make portage use it if file exists... Opinions? --=20 Peter. --=-N6EcN54LcVXgc2y4E9I6 Content-Type: application/x-awk; name="generate-die-eclass-env" Content-Disposition: attachment; filename="generate-die-eclass-env" Content-Transfer-Encoding: 7bit #!/usr/bin/awk -f # drop () if exist function stripname(funcname) { gsub("[(][)]","",funcname) return funcname } function do_die_statement(funcname) { print funcname"() { die \"you need to inherit "FILENAME" to use epatch\" ; }" } /^[a-zA-Z0-9_]+[(][)]/{do_die_statement(stripname($1))} /^function/{do_die_statement(stripname($2))} --=-N6EcN54LcVXgc2y4E9I6--