1 |
On Sat, Apr 28, 2012 at 06:14:30PM +0100, Ciaran McCreesh wrote: |
2 |
> On Sat, 28 Apr 2012 19:11:03 +0200 |
3 |
> Tiziano M??ller <dev-zero@g.o> wrote: |
4 |
> > Could we also get an interface to disk- and memory-space requirements? |
5 |
> > |
6 |
> > Something like: |
7 |
> > |
8 |
> > EREQUIRE_DISK="2G" |
9 |
> > EREQUIRE_MEMORY="1G" |
10 |
> > |
11 |
> > which gets checked in pre_pkg_setup? |
12 |
> |
13 |
> Is there anything the package mangler can do better than check-reqs |
14 |
> here? |
15 |
|
16 |
It can do it w/out going to bash, which is going to slow down the |
17 |
resolution validation- the time spent on pkg_pretend, particularly bad |
18 |
ones, is surprisingly high. |
19 |
|
20 |
One potential thought there; for things like kernel checks, it would |
21 |
be nice if there was some way to cache those results. |
22 |
|
23 |
Specifically, have the check set a var/id in some fashion, which the |
24 |
PM then exposes in later pkg_pretend invocations, which the |
25 |
eclass/bash implementation could check for and bypass the check. |
26 |
|
27 |
Mind you, this is a bit crazy, but something like the following |
28 |
primitives: |
29 |
|
30 |
pms_register_pretend_succeeded <identifier> |
31 |
pms_register_pretend_ran_already <identifier> |
32 |
|
33 |
Then for convenience, having a handler like thus: |
34 |
pms_pretend_run_once [<identifier> function <args> | function] |
35 |
|
36 |
So, using ati-drivers as an example, the pkg_pretend goes from |
37 |
pkg_pretend() { |
38 |
# workaround until bug 365543 is solved |
39 |
if use modules; then |
40 |
linux-info_pkg_setup |
41 |
require_configured_kernel |
42 |
_check_kernel_config |
43 |
fi |
44 |
} |
45 |
|
46 |
to |
47 |
pkg_pretend() { |
48 |
if use modules; then |
49 |
linux-info_pkg_setup |
50 |
pms_pretend_run_once require_configured_kernel |
51 |
pms_pretend_run_once _check_kernel-config |
52 |
fi |
53 |
} |
54 |
|
55 |
You get the idea; in doing so, we'd chop .3s-1s off every one of |
56 |
those. |
57 |
|
58 |
Either way, just a thought- feel free to shred it. |
59 |
~harring |