2010-12-08 07:47:26 +00:00
|
|
|
#!/usr/bin/python
|
|
|
|
|
|
|
|
# generates a Fedora distro package status file for hackage.haskell.org
|
|
|
|
|
|
|
|
from fedora.client import PackageDB
|
|
|
|
import koji
|
2011-02-09 03:26:33 +00:00
|
|
|
import sys
|
|
|
|
|
|
|
|
if len(sys.argv) > 1:
|
|
|
|
release = sys.argv[1]
|
|
|
|
else:
|
|
|
|
release = 'f14'
|
|
|
|
print release + ':'
|
2010-12-08 07:47:26 +00:00
|
|
|
|
|
|
|
pkgdb = PackageDB()
|
|
|
|
p = pkgdb.user_packages('haskell-sig')
|
|
|
|
|
|
|
|
# exclude packages not in Hackage
|
2011-01-29 10:51:26 +00:00
|
|
|
packages = [pkg['name'] for pkg in p.pkgs if pkg['name'] not in ['cabal2spec','emacs-haskell-mode','ghc','ghc-gtk2hs','ghc-rpm-macros','haskell-platform','hugs98']]
|
2010-12-08 07:47:26 +00:00
|
|
|
|
|
|
|
session = koji.ClientSession('http://koji.fedoraproject.org/kojihub')
|
|
|
|
|
2010-12-09 06:28:58 +00:00
|
|
|
outlist = []
|
|
|
|
|
2010-12-08 07:47:26 +00:00
|
|
|
for pkg in packages:
|
2011-02-09 03:26:33 +00:00
|
|
|
latest = session.getLatestBuilds('dist-' + release + '-updates', package=pkg)
|
2010-12-08 07:47:26 +00:00
|
|
|
if latest:
|
|
|
|
ver = latest[0]['version']
|
|
|
|
name = pkg.replace('ghc-','',1)
|
2010-12-09 06:28:58 +00:00
|
|
|
print "%s-%s" % (name,ver)
|
2011-01-29 10:51:26 +00:00
|
|
|
result = "(\"%s\",\"%s\",Just \"https://admin.fedoraproject.org/community/?package=%s#package_maintenance\")" % (name,ver,pkg)
|
2010-12-09 06:28:58 +00:00
|
|
|
outlist.append(result)
|
|
|
|
|
2011-02-09 03:26:33 +00:00
|
|
|
f = open(release, 'w')
|
2010-12-08 07:47:26 +00:00
|
|
|
|
2010-12-09 06:28:58 +00:00
|
|
|
for l in sorted(outlist):
|
|
|
|
f.write(l+'\n')
|