2013/8/9 Peter FELECAN <pfele...@opencsw.org>:
> "Maciej (Matchek) BliziƄski" <mac...@opencsw.org> writes:
>
>> 2013/8/9 Peter FELECAN <pfele...@opencsw.org>:
>>> I created this page:
>>>
>>> http://wiki.opencsw.org/python-2-x-multi-versioned-modules
>>>
>>> on which we can list the modules transition to the multi-versioned
>>> recipe.
>>
>> This can and should be populated automatically. We can use the REST
>> API to look for files in specific directories, and list them. I'll see
>> if I can write such a tool; I'll extend the API if necessary.
>
> Great. I must confess that I wasn't very enthusiastic to maintain that
> page by hand.

I've just implemented the backend part and the client library method.
http://sourceforge.net/apps/trac/gar/changeset/21707

An example call using curl:

curl 
http://buildfarm.opencsw.org/pkgdb/rest/catalogs/unstable/i386/SunOS5.10/pkgnames-and-paths-by-basedir?basedir=/opt/csw/lib/python;
echo

The client library has the new method GetPathsAndPkgnamesByBasedir(),
it returns a dictionary from package names to the list of files.

The most rudimentary shell helper would be:

function pkgs_in_dir() { curl -s
http://buildfarm.opencsw.org/pkgdb/rest/catalogs/unstable/i386/SunOS5.10/pkgnames-and-paths-by-basedir?basedir=$1
| python -c "import cjson; import sys; print
'\n'.join(sorted(cjson.decode(sys.stdin.read())))"; }

Then you can call it:
pkgs_in_dir /opt/csw/lib/python2.7

The query is currently very slow, runs for more than 1 minute. I'll
see if I can speed it up.

I'll leave it to you to dress the returned data structure in the wiki
syntax to make a table.

Maciej
_______________________________________________
maintainers mailing list
maintainers@lists.opencsw.org
https://lists.opencsw.org/mailman/listinfo/maintainers
.:: This mailing list's archive is public. ::.

Reply via email to