Gentoo Archives: gentoo-pms

From: Brian Harring <ferringb@×××××.com>
To: gentoo-pms@l.g.o
Subject: Re: [gentoo-pms] EAPI 5 (Was: Re: [gentoo-dev] Re: Making user patches globally available)
Date: Sun, 29 Apr 2012 03:25:00
Message-Id: 20120429032454.GB3134@localhost
In Reply to: Re: [gentoo-pms] EAPI 5 (Was: Re: [gentoo-dev] Re: Making user patches globally available) by Ciaran McCreesh
On Sat, Apr 28, 2012 at 06:14:30PM +0100, Ciaran McCreesh wrote:
> On Sat, 28 Apr 2012 19:11:03 +0200 > Tiziano M??ller <dev-zero@g.o> wrote: > > Could we also get an interface to disk- and memory-space requirements? > > > > Something like: > > > > EREQUIRE_DISK="2G" > > EREQUIRE_MEMORY="1G" > > > > which gets checked in pre_pkg_setup? > > Is there anything the package mangler can do better than check-reqs > here?
It can do it w/out going to bash, which is going to slow down the resolution validation- the time spent on pkg_pretend, particularly bad ones, is surprisingly high. One potential thought there; for things like kernel checks, it would be nice if there was some way to cache those results. Specifically, have the check set a var/id in some fashion, which the PM then exposes in later pkg_pretend invocations, which the eclass/bash implementation could check for and bypass the check. Mind you, this is a bit crazy, but something like the following primitives: pms_register_pretend_succeeded <identifier> pms_register_pretend_ran_already <identifier> Then for convenience, having a handler like thus: pms_pretend_run_once [<identifier> function <args> | function] So, using ati-drivers as an example, the pkg_pretend goes from pkg_pretend() { # workaround until bug 365543 is solved if use modules; then linux-info_pkg_setup require_configured_kernel _check_kernel_config fi } to pkg_pretend() { if use modules; then linux-info_pkg_setup pms_pretend_run_once require_configured_kernel pms_pretend_run_once _check_kernel-config fi } You get the idea; in doing so, we'd chop .3s-1s off every one of those. Either way, just a thought- feel free to shred it. ~harring