import Outputable
import System.Environment ( getEnv )
-import Distribution.InstalledPackageInfo
-import Distribution.Package
+import Distribution.InstalledPackageInfo hiding (depends)
+import Distribution.Package hiding (depends)
import Distribution.Version
import FastString
import ErrUtils ( debugTraceMsg, putMsg, Message )
:: DynFlags -> PackageConfigMap -> FilePath -> IO PackageConfigMap
readPackageConfig dflags pkg_map conf_file = do
debugTraceMsg dflags 2 (text "Using package config file:" <+> text conf_file)
- proto_pkg_configs <- loadPackageConfig conf_file
+ proto_pkg_configs <- loadPackageConfig dflags conf_file
let top_dir = topDir dflags
pkg_configs1 = mungePackagePaths top_dir proto_pkg_configs
pkg_configs2 = maybeHidePackages dflags pkg_configs1
-- A package named on the command line can either include the
-- version, or just the name if it is unambiguous.
matches str p
- = str == showPackageId (package p)
+ = str == display (package p)
|| str == pkgName (package p)
pickPackages :: [PackageConfig] -> [String] -> [PackageConfig]
| (p' : _) <- later_versions = do
debugTraceMsg dflags 2 $
(ptext (sLit "hiding package") <+>
- text (showPackageId (package p)) <+>
+ text (display (package p)) <+>
ptext (sLit "to avoid conflict with later version") <+>
- text (showPackageId (package p')))
+ text (display (package p')))
return (p {exposed=False})
| otherwise = return p
where myname = pkgName (package p)
ptext (sLit "wired-in package ")
<> text wired_pkg
<> ptext (sLit " mapped to ")
- <> text (showPackageId (package pkg))
+ <> text (display (package pkg))
return (Just (package pkg))
debugTraceMsg dflags 2 $
(ptext (sLit "package") <+> pprPkg p <+>
ptext (sLit "will be ignored due to missing or recursive dependencies:") $$
- nest 2 (hsep (map (text.showPackageId) deps)))
+ nest 2 (hsep (map (text.display) deps)))
-- -----------------------------------------------------------------------------
-- When all the command-line options are in, we can process our package
hidden_mods = hiddenModules pkg
pprPkg :: PackageConfig -> SDoc
-pprPkg p = text (showPackageId (package p))
+pprPkg p = text (display (package p))
-- -----------------------------------------------------------------------------
-- Extracting information from the packages in scope
putMsg dflags $
vcat (map (text.showInstalledPackageInfo.to_ipi) (eltsUFM pkg_map))
where
- to_ipi pkgconf@InstalledPackageInfo_{ exposedModules = e,
- hiddenModules = h } =
+ to_ipi pkgconf@(InstalledPackageInfo { exposedModules = e,
+ hiddenModules = h }) =
pkgconf{ exposedModules = map moduleNameString e,
hiddenModules = map moduleNameString h }
\end{code}