Permalink
Browse files

Distribution.Gentoo.GHC: export 'pkgListPrint' and silence 'allInstal…

…ledPackages'

Moved all the code spamming to console out from 'allInstalledPackages'
to main module.

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
  • Loading branch information...
1 parent a9ea29d commit ebad6e2ad6338a5b3d1a4fb58ab26517a0f23af7 @trofi trofi committed Jul 1, 2012
Showing with 7 additions and 5 deletions.
  1. +2 −4 Distribution/Gentoo/GHC.hs
  2. +5 −1 Main.hs
View
6 Distribution/Gentoo/GHC.hs
@@ -15,6 +15,7 @@ module Distribution.Gentoo.GHC
, oldGhcPkgs
, brokenPkgs
, allInstalledPackages
+ , pkgListPrint
) where
import Distribution.Gentoo.Util
@@ -242,11 +243,8 @@ getBroken = liftM (mapMaybe simpleParse . words)
-- -----------------------------------------------------------------------------
allInstalledPackages :: IO [Package]
-allInstalledPackages = do putStrLn "Finding all libraries installed with the \
- \current version of GHC."
- libDir <- ghcLibDir
+allInstalledPackages = do libDir <- ghcLibDir
let libDir' = BS.pack libDir
pkgs <- liftM notGHC
$ pkgsHaveContent $ hasDirMatching (==libDir')
- pkgListPrint "installed" pkgs
return pkgs
View
6 Main.hs
@@ -81,7 +81,11 @@ data BuildTarget = GhcUpgrade
getPackages :: BuildTarget -> IO [Package]
getPackages GhcUpgrade = oldGhcPkgs
getPackages DepCheck = brokenPkgs
-getPackages AllInstalled = allInstalledPackages
+getPackages AllInstalled =
+ do putStrLn "Finding all libraries installed with the current version of GHC."
+ pkgs <- allInstalledPackages
+ pkgListPrint "installed" pkgs
+ return pkgs
allGetPackages :: Set.Set BuildTarget -> IO [Package]
allGetPackages = liftM nub

0 comments on commit ebad6e2

Please sign in to comment.