[csw-maintainers] pkgname2catalogname

Maciej (Matchek) Bliziński maciej at opencsw.org
Thu Apr 19 18:41:48 CEST 2012

The Department of Random Restful Utilities teases you with code of a
utility printing catalognames based on pkgnames you give it.

#!/usr/bin/env python2.6
import json
import sys
import urllib2
base_url = "http://buildfarm.opencsw.org/pkgdb/rest"
url = ("%s/catalogs/unstable/i386/SunOS5.10/pkgnames/%s/"
       % (base_url, sys.argv[1]))
j = urllib2.urlopen(url).read()
print json.loads(j)["catalogname"]

Error checking? What error checking?


More information about the maintainers mailing list