Permalink
Browse files

Simplified the regular expression that filters attributes from GHC ve…

…rsions other than the current default (7.0.4).
  • Loading branch information...
1 parent 00014d7 commit efcb548db580020393faed887af841463ab2999c @peti committed Feb 3, 2012
Showing with 3 additions and 13 deletions.
  1. +3 −13 package-list.hs
View
@@ -1,6 +1,5 @@
module Main ( main ) where
-import Control.Exception ( assert )
import Data.Char ( toLower )
import Data.List ( nubBy, sortBy )
import Data.Ord ( comparing )
@@ -39,17 +38,8 @@ getHaskellPackageList = do
allPkgs <- fmap lines (readProcess "bash" ["-c", "exec nix-env -qaP \\* 2>/dev/tty"] "")
return [ p | Just p <- map parseHaskellPackageName allPkgs ]
-stripProfilingVersions :: Pkgset -> Pkgset
-stripProfilingVersions pkgs = [ p | p@(_,_,attr) <- pkgs , not (attr =~ "ghc[0-9.]+_profiling") ]
-
-stripGhc721Versions :: Pkgset -> Pkgset
-stripGhc721Versions pkgs = [ p | p@(_,_,attr) <- pkgs , not (attr =~ "ghc721") ]
-
-stripGhc722Versions :: Pkgset -> Pkgset
-stripGhc722Versions pkgs = [ p | p@(_,_,attr) <- pkgs , not (attr =~ "ghc722") ]
-
-stripGhcHeadVersions :: Pkgset -> Pkgset
-stripGhcHeadVersions pkgs = [ p | p@(_,_,attr) <- pkgs , not (attr =~ "ghcHEAD") ]
+selectReleaseVersions :: Pkgset -> Pkgset
+selectReleaseVersions pkgs = [ p | p@(_,_,attr) <- pkgs, not (attr =~ "haskellPackages_ghc(6104|6123|741|704_profiling|HEAD)") ]
selectLatestVersions :: Pkgset -> Pkgset
selectLatestVersions = nubBy (\x y -> comparePkgByName x y == EQ) . sortBy comparePkgByVersion
@@ -73,5 +63,5 @@ main :: IO ()
main = do
hackage <- readHackage
pkgset' <- fmap (filter (isHackagePackage hackage)) getHaskellPackageList
- let pkgset = (selectLatestVersions . stripGhc721Versions . stripGhc722Versions . stripGhcHeadVersions . stripProfilingVersions) pkgset'
+ let pkgset = (selectLatestVersions . selectReleaseVersions) pkgset'
mapM_ (putStrLn . formatPackageLine) (sortBy comparePkgByName pkgset)

0 comments on commit efcb548

Please sign in to comment.