summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-07-19 00:26:13 +0000
committerIan Lynagh <igloo@earth.li>2008-07-19 00:26:13 +0000
commitfd5d8c682af7058a6cab4f5e1ee0728321c45d17 (patch)
treede02f77282f8d37f439a6231f1de196e101614f3 /utils
parentf893fb935d23418b80534b05f35fe50d54af0acc (diff)
downloadhaskell-fd5d8c682af7058a6cab4f5e1ee0728321c45d17.tar.gz
Fix ghc-pkg inplace on Windows
Diffstat (limited to 'utils')
-rw-r--r--utils/ghc-pkg/Main.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index 7f727d7966..bb80e63163 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"