* [gentoo-portage-dev] Portage persistence structures :: information about ports tree
@ 2008-06-09 20:36 João Macaíba
2008-06-09 23:07 ` Marius Mauch
2008-06-10 1:37 ` Zac Medico
0 siblings, 2 replies; 5+ messages in thread
From: João Macaíba @ 2008-06-09 20:36 UTC (permalink / raw
To: gentoo-portage-dev
Hi.
I'm reading portage docs and sources at /usr/lib/portage trying to
understand how portage persists information on 'available ports'.
So, I'm reading /usr/lib/portage/bin/emerge:
--- snip ---
portdb = trees["porttree"].dbapi
--- snip ---
Where 'trees' is a parameter to 'search's object construction.
But who really uses 'search class' is 'action_search' as we can see
below:
--- snip ---
def action_search(settings, trees, myopts, myfiles, spinner):
[...]
searchinstance = search(settings, trees,
spinner, "--searchdesc" in myopts,
"--quiet" not in myopts, "--usepkg" in myopts,
"--usepkgonly" in myopts)
[...]
--- snip ---
Later in 'emerge' file we have
--- snip ---
action_search(settings, trees[settings["ROOT"]],
--- snip ---
... and so on ...
I'm trying to track the calls, instantiations, etc to figure out how
portage persists ports info.
May someone give me some help on this ? How does portage do the
searchs ? Walk into the ports tree and build some structure or store
this info on some embedded database like berkeley db or sqlite ?
Thanks in advance.
--
João Macaíba <joao.macaiba@gmail.com>
--
gentoo-portage-dev@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] Portage persistence structures :: information about ports tree
2008-06-09 20:36 [gentoo-portage-dev] Portage persistence structures :: information about ports tree João Macaíba
@ 2008-06-09 23:07 ` Marius Mauch
2008-06-09 23:51 ` João Macaíba
2008-06-10 1:37 ` Zac Medico
1 sibling, 1 reply; 5+ messages in thread
From: Marius Mauch @ 2008-06-09 23:07 UTC (permalink / raw
To: gentoo-portage-dev
On Mon, 09 Jun 2008 17:36:14 -0300
João Macaíba <joao.macaiba@gmail.com> wrote:
> May someone give me some help on this ? How does portage do the
> searchs ? Walk into the ports tree and build some structure or store
> this info on some embedded database like berkeley db or sqlite ?
You're probably looking for the portdbapi class defined in
pym/portage.py (or pym/portage/dbapi/porttree.py in 2.2), in particular
the cp_all(), cpv_all(), cp_list() and aux_get() methods.
Marius
--
gentoo-portage-dev@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] Portage persistence structures :: information about ports tree
2008-06-09 23:07 ` Marius Mauch
@ 2008-06-09 23:51 ` João Macaíba
2008-06-10 1:55 ` Brian
0 siblings, 1 reply; 5+ messages in thread
From: João Macaíba @ 2008-06-09 23:51 UTC (permalink / raw
To: gentoo-portage-dev
On Tue, 2008-06-10 at 01:07 +0200, Marius Mauch wrote:
> On Mon, 09 Jun 2008 17:36:14 -0300
> João Macaíba <joao.macaiba@gmail.com> wrote:
>
> > May someone give me some help on this ? How does portage do the
> > searchs ? Walk into the ports tree and build some structure or store
> > this info on some embedded database like berkeley db or sqlite ?
>
> You're probably looking for the portdbapi class defined in
> pym/portage.py (or pym/portage/dbapi/porttree.py in 2.2), in particular
> the cp_all(), cpv_all(), cp_list() and aux_get() methods.
>
> Marius
Thanks very much, Marius, for you help/time ! :)
I'll take a look at them.
Best regards.
--
João Macaíba <joao.macaiba@gmail.com>
--
gentoo-portage-dev@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] Portage persistence structures :: information about ports tree
2008-06-09 23:51 ` João Macaíba
@ 2008-06-10 1:55 ` Brian
0 siblings, 0 replies; 5+ messages in thread
From: Brian @ 2008-06-10 1:55 UTC (permalink / raw
To: gentoo-portage-dev
On Mon, 2008-06-09 at 20:51 -0300, João Macaíba wrote:
> On Tue, 2008-06-10 at 01:07 +0200, Marius Mauch wrote:
> > On Mon, 09 Jun 2008 17:36:14 -0300
> > João Macaíba <joao.macaiba@gmail.com> wrote:
> >
> > > May someone give me some help on this ? How does portage do the
> > > searchs ? Walk into the ports tree and build some structure or store
> > > this info on some embedded database like berkeley db or sqlite ?
> >
> > You're probably looking for the portdbapi class defined in
> > pym/portage.py (or pym/portage/dbapi/porttree.py in 2.2), in particular
> > the cp_all(), cpv_all(), cp_list() and aux_get() methods.
> >
> > Marius
>
I think for searching you may find the xmatch function to be a very
versatile and useful tool. I think it is one of the more used functions
that porthole uses from portage.
> Thanks very much, Marius, for you help/time ! :)
>
> I'll take a look at them.
>
> Best regards.
> --
> João Macaíba <joao.macaiba@gmail.com>
>
--
Brian <dol-sen@telus.net>
--
gentoo-portage-dev@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [gentoo-portage-dev] Portage persistence structures :: information about ports tree
2008-06-09 20:36 [gentoo-portage-dev] Portage persistence structures :: information about ports tree João Macaíba
2008-06-09 23:07 ` Marius Mauch
@ 2008-06-10 1:37 ` Zac Medico
1 sibling, 0 replies; 5+ messages in thread
From: Zac Medico @ 2008-06-10 1:37 UTC (permalink / raw
To: gentoo-portage-dev
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
João Macaíba wrote:
> May someone give me some help on this ? How does portage do the
> searchs ? Walk into the ports tree and build some structure or store
> this info on some embedded database like berkeley db or sqlite ?
If you want to use sqlite, you might find this useful:
http://gentoo-wiki.com/TIP_speed_up_portage_with_sqlite
Zac
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEARECAAYFAkhN2tgACgkQ/ejvha5XGaMxqACgqCDf40D3UHrvrTsyGACfIPJ8
HgUAoKKeHLASAaO6KrJXW8jpCg/0dWin
=r1mc
-----END PGP SIGNATURE-----
--
gentoo-portage-dev@lists.gentoo.org mailing list
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-10 1:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-09 20:36 [gentoo-portage-dev] Portage persistence structures :: information about ports tree João Macaíba
2008-06-09 23:07 ` Marius Mauch
2008-06-09 23:51 ` João Macaíba
2008-06-10 1:55 ` Brian
2008-06-10 1:37 ` Zac Medico
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox