From eed0f8bfc5e8c8e3677fece39616b24e121eea69 Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Wed, 8 Dec 2010 17:47:26 +1000 Subject: [PATCH] convert hackage-status.sh to hackage-fedora.py which reads package list straight from pkgdb --- hackage-fedora.py | 24 ++++++++++++++++++++++++ hackage-status.sh | 21 --------------------- 2 files changed, 24 insertions(+), 21 deletions(-) create mode 100755 hackage-fedora.py delete mode 100755 hackage-status.sh diff --git a/hackage-fedora.py b/hackage-fedora.py new file mode 100755 index 0000000..66546e4 --- /dev/null +++ b/hackage-fedora.py @@ -0,0 +1,24 @@ +#!/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') + +for pkg in packages: + latest = session.getLatestBuilds('dist-rawhide', package=pkg) + if latest: + ver = latest[0]['version'] + name = pkg.replace('ghc-','',1) + print "(\"%s\",\"%s\",Just \"https://admin.fedoraproject.org/pkgdb/acls/name/%s\")" % (name,ver,pkg) + +# todo +## sort output diff --git a/hackage-status.sh b/hackage-status.sh deleted file mode 100755 index dd9c870..0000000 --- a/hackage-status.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh - -# generates a Fedora distro package status file for hackage.haskell.org - -PKGS="ghc-Boolean ghc-GLUT ghc-HTTP ghc-HUnit ghc-OpenGL ghc-QuickCheck ghc-X11 ghc-X11-xft alex ghc-attoparsec ghc-base64-bytestring ghc-binary ghc-bytestring-trie cabal-install ghc-cairo ghc-cgi ghc-chalmers-lava2000 ghc-cmdargs ghc-colour cpphs ghc-csv darcs ghc-dataenc ghc-deepseq ghc-editline ghc-feldspar-language ghc-fgl ghc-ghc-paths ghc-gio ghc-glade ghc-glib ghc-gtk gtk2hs-buildtools ghc-gtksourceview2 happy ghc-hashed-storage ghc-haskeline ghc-haskell-src ghc-haskell-src-exts ghc-hinotify hlint hscolour ghc-hslogger ghc-html ghc-libmpd ghc-mmap ghc-mtl ghc-network ghc-pango ghc-parallel ghc-parsec ghc-regex-base ghc-regex-compat ghc-regex-posix ghc-regex-tdfa ghc-split ghc-stm ghc-syb ghc-tagsoup ghc-tar ghc-terminfo ghc-text ghc-transformers ghc-type-level ghc-uniplate ghc-utf8-string ghc-xhtml xmobar xmonad ghc-xmonad-contrib ghc-zlib" - -if [ -f Fedora ]; then - mv -f Fedora Fedora.previous -fi - -for p in $PKGS; do - LATEST=$(koji latest-pkg --quiet dist-rawhide $p | cut -f1 -d' ' | sed -e "s/\(.*\)-.*/\1/") - HACKAGE=$(echo $p | sed -e "s/^ghc-//") - VERSION=$(echo $LATEST | sed -e "s/^$p-//") - if [ -n "$VERSION" ]; then - echo $HACKAGE-$VERSION - echo "(\"$HACKAGE\",\"$VERSION\",Just \"https://admin.fedoraproject.org/pkgdb/acls/name/$p\")" >> Fedora - else - echo ** No version for: $HACKAGE ** - fi -done