From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9A5CF138010 for ; Thu, 13 Sep 2012 03:31:52 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 43ED021C025; Thu, 13 Sep 2012 03:31:44 +0000 (UTC) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by pigeon.gentoo.org (Postfix) with ESMTP id AB2C621C030 for ; Thu, 13 Sep 2012 03:30:29 +0000 (UTC) Received: by vchn11 with SMTP id n11so870848vch.40 for ; Wed, 12 Sep 2012 20:30:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=uyDK+fmhLlONWc7lCOFotoM7Gpo06hIqweLut7Eag1U=; b=rS2xjx9fJ6qj+AQu7N7m14eYB6oJX5kZzvqYXOPTO1wfUUveC5uOjChTGXRem3xw2a zAecSjLqzMqHYl82lj/D2So5FV6pk62HmqNTUbAvc/ifoIFhm4SXO6mTM6gpOoYuEHUS rBmQoXpKIrEvxGzC/logYq+L/aHTw0jXnPjq62B5EocvPJzPilkjklmIzwOoFL8/xF2P VFyHG+zLBcdpycRyzbVBxzEkrdwqhLaiDO27Zdq+YZljM+aJQPpMthDnyODxMq41aCK8 9CzEMiocLjKFUwZlIjdJmYJp2FJMzSnGpKF2OFTobJ5MC2lYIxKiNOoDis+Q3+0xfxwv yD0Q== 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.58.32.233 with SMTP id m9mr413346vei.23.1347507029218; Wed, 12 Sep 2012 20:30:29 -0700 (PDT) Sender: yngwin@gmail.com Received: by 10.58.58.110 with HTTP; Wed, 12 Sep 2012 20:30:29 -0700 (PDT) In-Reply-To: <20120912203621.GA28593@localhost> References: <20120912203621.GA28593@localhost> Date: Thu, 13 Sep 2012 11:30:29 +0800 X-Google-Sender-Auth: iPDi-wirMLHQoljdl0XkU5ZR2XM Message-ID: Subject: Re: [gentoo-dev] EAPI5: require ebuilds/eclasses to not use any vars/funcs prefixed with __ From: Ben de Groot To: gentoo-dev@lists.gentoo.org Content-Type: text/plain; charset=UTF-8 X-Archives-Salt: f13e1615-c0f1-4787-ae13-af9d32624273 X-Archives-Hash: cd57c957201e4fd040e9fef0eb88409c On 13 September 2012 04:36, Brian Harring wrote: > Hola folks. > > Currently portage exposes a fair amount of it's internal > implementation via vars/funcs into the ebulid env; this frankly makes > it easier for ebuilds/eclasses to localize themselves to portage > (rather than PMS), leading to breakage. > > Thus a proposal for EAPI5 has been made, banning ebuilds/eclasses from > using/accessing __, and requiring the PM to store it's internals in > that namespace. > > Basically, instead of portage doing thus: > > is_function dyn_pkg_preinst && dyn_pkg_preinst > > It does thus: > > __is_function __dyn_pkg_preinst && __dyn_pkg_preinst. > > Aside from avoiding accidental conflicts/usage, the standardized > namespacing makes it a helluva lot easier to have repoman/qa tools > look for bad usage. > > Currently, there is a minor amount of ebuild/eclass usage of things > named __*; ~90% of it is 'import once' eclass code like the following: > > """ > if [[ ${___ECLASS_ONCE_LIBTOOL} != "recur -_+^+_- spank" ]] ; then > ___ECLASS_ONCE_LIBTOOL="recur -_+^+_- spank > """ > > Converting that is easy enough, and I'll be doing that work for > gentoo-x86 if folks don't have an issue. > > Note there is a few vars we need to exempt; that list is currently > SANDBOX_* and FEATURES. FEATURES is fine to exempt from this rule. > > For SANDBOX_*, while that's a PM internal, that's a bit of a grey > zone; regardless, we can actually address that via extending the > sandbox functions a bit: > > addwrite [-r|--remove] pathway # for example, to do a removal. > > For instances where the sandbox needs to be turned off for a command- > we do the same thing we did w/ nonfatal; > > sandboxless > > which is just > sandboxless() { > SANDBOX_ON=0 "$@" > } > > or SYDBOX_ON=0 (or their equivalent var) for sydbox usage. > > Comments? > ~harring > I support this. It seems very sane. -- Cheers, Ben | yngwin Gentoo developer Gentoo Qt project lead, Gentoo Wiki admin