Permalink
Browse files

A much nicer and faster version of allInstalledPackages

Went from about 3 minutes to instant!
  • Loading branch information...
1 parent 38db99c commit 933041930eaecf2d96d4743e0e1a344160aa921a @ivan-m ivan-m committed Jul 31, 2010
Showing with 8 additions and 3 deletions.
  1. +8 −3 Distribution/Gentoo/GHC.hs
View
@@ -244,6 +244,11 @@ getBroken = liftM (mapMaybe simpleParse . words)
-- -----------------------------------------------------------------------------
allInstalledPackages :: IO [Package]
-allInstalledPackages = do cm <- readConf
- let confs = Map.elems cm
- checkPkgs "installed Haskell libraries" "installed" ([], confs)
+allInstalledPackages = do putStrLn "Finding all libraries installed with the \
+ \current version of GHC."
+ libDir <- ghcLibDir
+ let libDir' = BS.pack libDir
+ pkgs <- liftM notGHC
+ $ pkgsHaveContent $ hasDirMatching (==libDir')
+ pkgListPrint "installed" pkgs
+ return pkgs

0 comments on commit 9330419

Please sign in to comment.