From fd5d8c682af7058a6cab4f5e1ee0728321c45d17 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 19 Jul 2008 00:26:13 +0000 Subject: [PATCH] Fix ghc-pkg inplace on Windows --- utils/ghc-pkg/Main.hs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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" -- 1.7.10.4