* [gentoo-dev] new portage database tool
@ 2001-09-17 18:59 Chris Houser
0 siblings, 0 replies; only message in thread
From: Chris Houser @ 2001-09-17 18:59 UTC (permalink / raw
To: gentoo-dev
I wrote a little tool to help track which package owns each file in a
gentoo system. I'm calling it pdb for now, for lack of a better name.
It is currently only in the gentoo-src CVS tree.
The heart of the tool is a python module gentoo-src/portage/pym/portagedb.py
I guess this needs to be copied somewhere that python can find it in
order to use it. There are two front-ends, both in
gentoo-src/portage/bin, named 'pdb' and 'pdb.cgi'. The first is a
command-line tool, described below. The second is a CGI (surprise!)
that provides the same functionality as the command-line tool, but
through a web interface.
Each of these front-ends has a small config section at the top that you
will probably want to modify before using.
To start using pdb locally, you must first store the packages you want
to be able to look up:
$ pdb --local --store foo/bar-1.2.3
This uses the CONTENTS file in the specified /var/db/pkg dir to populate
the local database. To store all your packages, you could:
$ cd /var/db/pkg; pdb -l -s */*
To look up a file, use the --query command. For now, you may only give
one query at a time, and it must be the full path a file. Multiple
queries, wildcards, and other features may be added later if it seems
worth it at that point.
$ pdb --local --query /usr/lib/libnsl.a
sys-libs/glibc-2.2.4-r1
obj /usr/lib/libnsl.a B0C142667130D58EC72530CDB9FFBAD3 999228261
As you can see, this simply returns which package the file belongs to,
and the related CONTENTS line.
Where this really gets fun is if we set up a central server running the
CGI version. Not only can this be accessed through a web browser, but
also through the command-line tool. If you leave off the '--local' or
'-l' switches in any of the above examples, the local tool will try to
connect to the server listed in it's config lines, instead of working
with a local database. This would allow you to query for files that you
have not yet installed
For example, if you are trying to make an ebuild and the ./configure
script whines about not being able to find 'libfoobar.so', just do:
$ pdb -q /usr/lib/libfoobar.so
...and if anyone has stored that package to the server, you should get
back the name of the package you need to install.
--Chouser
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2001-09-18 0:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-09-17 18:59 [gentoo-dev] new portage database tool Chris Houser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox