1 |
On Tue, Jan 10, 2006 at 07:53:04PM +0100, Marius Mauch wrote: |
2 |
> Currently vardbapi.aux_get only works for a subset of all auxdbkeys, as |
3 |
> some like KEYWORDS or DESCRIPTIOn aren't stored in vdb directly. |
4 |
> They are however stored in environment.bz2, but not accessible |
5 |
> there. |
6 |
> This is unintuitive and limits tools like equery or my own auxget |
7 |
> and metascan tools in their usability. |
8 |
> |
9 |
> There are two solutions to this problem: |
10 |
> a) enhance vardbapi.aux_get so it can use environment.bz2 |
11 |
> b) store more keys in vdb |
12 |
> |
13 |
> Now there is a tradeoff to made: a) doesn't need space but is slow |
14 |
> while b) is fast but needs space, both in non-trivial amounts (runtime |
15 |
> increased from 1s to 9s for a metascan -i run and from 0.5s to 0.8s |
16 |
> for auxget -i, haven't actually checked the size increase, expect |
17 |
> somewhere between 1 and 10 megabytes on a typical install). |
18 |
> |
19 |
> I'm attaching a patch that implements both (each in it's own hunk) as |
20 |
> well as a new emaint option to create the missing entries offline. |
21 |
> |
22 |
> A not so obvious issue with a) is that due to the recent |
23 |
> storage optimizations (empty entries not being stored) it's worse than |
24 |
> I originally expected, as any entry missing a file will be looked up in |
25 |
> env.bz2 instead. Only way to avoid that would be to add special casing |
26 |
> in aux_get which I really dislike. |
27 |
> |
28 |
> Opinions? |
29 |
Use filter-env to pull the var out. |
30 |
|
31 |
Regex you've got there allows for pulling the wrong text- recall, ebd |
32 |
originally was doing grep based filtering (regex). Had to rewrite |
33 |
that in a major hurry since bash syntax (specifically here ops) forces |
34 |
you to track state/constructs rather then just a regex... |
35 |
|
36 |
Aside from that, while it's annoying, should do a one time pull- if a |
37 |
var is in a whitelist of "can be pulled from env", we pull all missing |
38 |
vars *once*. My opinion, at least. |
39 |
~harring |