You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ghc/hackage-fedora.py

31 lines
927 B

#!/usr/bin/python
# generates a Fedora distro package status file for hackage.haskell.org
from fedora.client import PackageDB
import koji
pkgdb = PackageDB()
p = pkgdb.user_packages('haskell-sig')
# exclude packages not in Hackage
packages = [pkg['name'] for pkg in p.pkgs if pkg['name'] not in ['cabal2spec','emacs-haskell-mode','ghc','ghc-gtk2hs','ghc-rpm-macros','haddock','haskell-platform','hugs98']]
session = koji.ClientSession('http://koji.fedoraproject.org/kojihub')
outlist = []
for pkg in packages:
latest = session.getLatestBuilds('dist-f14-updates', package=pkg)
if latest:
ver = latest[0]['version']
name = pkg.replace('ghc-','',1)
print "%s-%s" % (name,ver)
result = "(\"%s\",\"%s\",Just \"https://admin.fedoraproject.org/pkgdb/acls/name/%s\")" % (name,ver,pkg)
outlist.append(result)
f = open('Fedora', 'w')
for l in sorted(outlist):
f.write(l+'\n')