[csw-maintainers] REST: Getting paths and packages by basename

Maciej (Matchek) Blizinski maciej at opencsw.org
Wed Feb 22 16:56:02 CET 2012


I added a new RESTful URL. It allows you to give it a basename, e.g.
"libgcc_s.so.1" and get the list of paths under which this file occurs. For
example:

$ time curl -s "
http://buildfarm.opencsw.org/pkgdb/rest/catalogs/unstable/sparc/SunOS5.10/pkgnames-and-paths-by-basename?basename=bash"
| python -c "import json, pprint, sys;
pprint.pprint(json.loads(sys.stdin.read()))"
{u'/opt/csw/bin': [u'CSWbash'],
 u'/opt/csw/share/doc': [u'CSWbash'],
 u'/opt/csw/share/quilt/compat': [u'CSWquilt'],
 u'/usr/bin': [u'SUNWbash']}

real    0m0.558s
user    0m0.030s
sys     0m0.010s

(the python part is only to prettify the results)

This call is used by checkpkg to identify which shared libraries could a
binary link to. This is one of the more powerful queries that the checkpkg
database allows. It can also get quite slow if you're searching for
something occurring in many packages.

Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencsw.org/pipermail/maintainers/attachments/20120222/8a6c1e49/attachment.html>


More information about the maintainers mailing list