diff options
author | Simon Marlow <marlowsd@gmail.com> | 2009-09-10 10:27:03 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2009-09-10 10:27:03 +0000 |
commit | 930421d4ed09e5389e0ef4c5eef36075a6809cc0 (patch) | |
tree | f9f795c8b46a93a99f3a7495f6304f00fa42a2fb /compiler/main/PackageConfig.hs | |
parent | 5364ea8bd2086d3ce973988d583e3b4585d37b4d (diff) | |
download | haskell-930421d4ed09e5389e0ef4c5eef36075a6809cc0.tar.gz |
Change the representation of the package database
- the package DB is a directory containing one file per package
instance (#723)
- there is a binary cache of the database (#593, #2089)
- the binary package is now a boot package
- there is a new package, bin-package-db, containing the Binary
instance of InstalledPackageInfo for the binary cache.
Also included in this patch
- Use colour in 'ghc-pkg list' to indicate broken or hidden packages
Broken packages are red, hidden packages are
Colour support comes from the terminfo package, and is only used when
- not --simple-output
- stdout is a TTY
- the terminal type has colour capability
- Fix the bug that 'ghc-pkg list --user' shows everything as broken
Diffstat (limited to 'compiler/main/PackageConfig.hs')
-rw-r--r-- | compiler/main/PackageConfig.hs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/compiler/main/PackageConfig.hs b/compiler/main/PackageConfig.hs index ac1a9fe446..50c1e7105a 100644 --- a/compiler/main/PackageConfig.hs +++ b/compiler/main/PackageConfig.hs @@ -74,11 +74,9 @@ packageConfigToInstalledPackageInfo -- | Turn an 'InstalledPackageInfo', which contains Cabal 'Distribution.ModuleName.ModuleName's -- into a GHC specific 'PackageConfig' which contains GHC 'Module.ModuleName's -installedPackageInfoToPackageConfig :: InstalledPackageInfo -> PackageConfig +installedPackageInfoToPackageConfig :: InstalledPackageInfo_ String -> PackageConfig installedPackageInfoToPackageConfig (pkgconf@(InstalledPackageInfo { exposedModules = e, hiddenModules = h })) = - pkgconf{ exposedModules = map convert e, - hiddenModules = map convert h } - where convert :: Distribution.ModuleName.ModuleName -> Module.ModuleName - convert = mkModuleName . display + pkgconf{ exposedModules = map mkModuleName e, + hiddenModules = map mkModuleName h } |