summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'utils/ghc-pkg')
-rw-r--r--utils/ghc-pkg/Main.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 13a85cbaef..c29e4cfd13 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -83,6 +83,7 @@ import qualified Data.Foldable as F
import qualified Data.Traversable as F
import qualified Data.Set as Set
import qualified Data.Map as Map
+import qualified Data.ByteString as BS
#if defined(mingw32_HOST_OS)
import GHC.ConsoleHandler
@@ -948,7 +949,7 @@ readParseDatabase verbosity mb_user_conf mode use_cache path
parseSingletonPackageConf :: Verbosity -> FilePath -> IO InstalledPackageInfo
parseSingletonPackageConf verbosity file = do
when (verbosity > Normal) $ infoLn ("reading package config: " ++ file)
- readUTF8File file >>= fmap fst . parsePackageInfo
+ BS.readFile file >>= fmap fst . parsePackageInfo
cachefilename :: FilePath
cachefilename = "package.cache"
@@ -1143,7 +1144,7 @@ registerPackage input verbosity my_flags multi_instance
expanded <- if expand_env_vars then expandEnvVars s force
else return s
- (pkg, ws) <- parsePackageInfo expanded
+ (pkg, ws) <- parsePackageInfo $ toUTF8BS expanded
when (verbosity >= Normal) $
infoLn "done."
@@ -1177,7 +1178,7 @@ registerPackage input verbosity my_flags multi_instance
changeDB verbosity (removes ++ [AddPackage pkg]) db_to_operate_on db_stack
parsePackageInfo
- :: String
+ :: BS.ByteString
-> IO (InstalledPackageInfo, [ValidateWarning])
parsePackageInfo str =
case parseInstalledPackageInfo str of