From 6b476a9ab73f1d768c548ddef900f9b9e4a0dd6b Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 14 Jun 2008 12:34:27 +0000 Subject: [PATCH] Pass dynflags down to loadPackageConfig rather than using defaultDynFlags --- compiler/main/Packages.lhs | 2 +- compiler/main/ParsePkgConf.y | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/compiler/main/Packages.lhs b/compiler/main/Packages.lhs index 6a5b63c..c8b7d69 100644 --- a/compiler/main/Packages.lhs +++ b/compiler/main/Packages.lhs @@ -231,7 +231,7 @@ readPackageConfig :: 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 diff --git a/compiler/main/ParsePkgConf.y b/compiler/main/ParsePkgConf.y index 1a13108..1f6434b 100644 --- a/compiler/main/ParsePkgConf.y +++ b/compiler/main/ParsePkgConf.y @@ -149,11 +149,11 @@ strs :: { [FastString] } happyError :: P a happyError = srcParseFail -loadPackageConfig :: FilePath -> IO [PackageConfig] -loadPackageConfig conf_filename = do +loadPackageConfig :: DynFlags -> FilePath -> IO [PackageConfig] +loadPackageConfig dflags conf_filename = do buf <- hGetStringBuffer conf_filename let loc = mkSrcLoc (mkFastString conf_filename) 1 0 - case unP parse (mkPState buf loc defaultDynFlags) of + case unP parse (mkPState buf loc dflags) of PFailed span err -> throwDyn (InstallationError (showSDoc (mkLocMessage span err))) -- 1.7.10.4