Am Samstag, den 28.04.2012, 20:24 -0700 schrieb Brian Harring: > 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 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. pkg_pretend is not the (only) place to do the check since the available space may change during the install (for example when telling the PM to skip failed packages which may leave intermediate files of those packages for investigation). Furthermore, especially $T may not be available at pkg_pretend time. > > 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 > pms_register_pretend_ran_already > > Then for convenience, having a handler like thus: > pms_pretend_run_once [ function | 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 >