From: Ian Lynagh Date: Sat, 19 Jul 2008 00:26:13 +0000 (+0000) Subject: Fix ghc-pkg inplace on Windows X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=fd5d8c682af7058a6cab4f5e1ee0728321c45d17 Fix ghc-pkg inplace on Windows --- diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index 7f727d7..bb80e63 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -375,7 +375,16 @@ getPkgDatabases modify my_flags = do [] -> do mb_dir <- getExecDir "/bin/ghc-pkg.exe" case mb_dir of Nothing -> die err_msg - Just dir -> return (dir "package.conf") + Just dir -> + do let path1 = dir "package.conf" + path2 = dir ".." ".." ".." + "inplace-datadir" + "package.conf" + exists1 <- doesFileExist path1 + exists2 <- doesFileExist path2 + if exists1 then return path1 + else if exists2 then return path2 + else die "Can't find package.conf" fs -> return (last fs) let global_conf_dir = global_conf ++ ".d"