Thanks for the clarification. I was planning on forcing an update of the index as a part of emerge --sync, and implementing a command that would update the search index (leaving it up to the user to update after making any manual changes to the portage tree). That way the search index should always be up-to-date when emerge -s is called. It does make sense for the update upon --sync to be optional, but I guess I don't see why the update should always be SO slow. Of course the first population of the tree will take quite a while, but assuming regular (daily?) --syncs (and therefore updates to the index), subsequent updates shouldn't take very long, since there will only be a few (hundred?) changes to be made to the tree.
And I do plan on using a pickling the search tree :]
Emma
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Emma Strubell wrote:You should use portree.py to populate it. Specifically, you should
> I completely forgot about Google's Summer of Code! Thanks for reminding me.
> Hopefully I won't forget again by the time summer rolls around, obviously I
> wouldn't mind getting a little extra money for doing something I'd do for
> free anyway.
>
> On a more related note: What, exactly, does porttree.py do? And am I correct
> in thinking that my suffix tree(s) should somewhat replace porttree.py? Or,
> should I be using porttree.py in order to populate my tree?
use portdbapi.aux_get() calls to access the package metadata that
you'll need, similar to how the code in the existing search class
accesses it.
There are there possible times that I imagine a person might want to
> I think I have
> the suffix tree sufficiently figured out, I'm just trying to determine
> where, exactly, the tree will fit in to the portage code, and what the best
> way to populate it (with package names and some corresponding metadata)
> would be.
populate it:
1) Automatically after emerge --sync. This should not be mandatory
since it will be somewhat time consuming and some users are very
sensitive about --sync time. Note that FEATURES=metadate-transfer is
disabled by default in the latest versions of portage, specifically
to reduce --sync time.
2) On demand, when emerge --search is invoked. The calling user will
need appropriate file system permissions in order to update the
search index.
3) On request, by calling a command that is specifically designed to
generate the search index. This could be a subcommand of emaint.
For the index file format, it would be simplest to use a python
pickle file, but you might choose another format if you'd like the
index to be accessible without python and the portage API (probably
not necessary).
- --
Thanks,
Zac
-----BEGIN PGP SIGNATURE-----iEYEARECAAYFAkk0JFAACgkQ/ejvha5XGaONDACgixnmCh9Ei6MyUGIZXpiFt7F2
Version: GnuPG v2.0.9 (GNU/Linux)
gqMAoOhf5H2uZHB7xhjecOcL0G3w/cqR
=hFNz
-----END PGP SIGNATURE-----