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

Trygve Laugstøl trygvis at opencsw.org
Thu Feb 23 01:19:01 CET 2012


On 02/22/2012 04:56 PM, Maciej (Matchek) Blizinski wrote:
> 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']}

I see your Python and raise with:

$ time curl -s 
"http://buildfarm.opencsw.org/pkgdb/rest/catalogs/unstable/sparc/SunOS5.10/pkgnames-and-paths-by-basename?basename=bash" 
| python -mjson.tool
{
     "/opt/csw/bin": [
         "CSWbash"
     ],
     "/opt/csw/share/doc": [
         "CSWbash"
     ],
     "/opt/csw/share/quilt/compat": [
         "CSWquilt"
     ],
     "/usr/bin": [
         "SUNWbash"
     ]
}

real	0m0.391s
user	0m0.028s
sys	0m0.008s


> 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
>
>
> _______________________________________________
> maintainers mailing list
> maintainers at lists.opencsw.org
> https://lists.opencsw.org/mailman/listinfo/maintainers
> .:: This mailing list's archive is public. ::.

-- 
Trygve


More information about the maintainers mailing list