X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Futils%2Fghc-pkg%2FMain.hs;h=06563998f57d43b9a37c0857200e4ab053a428be;hb=0e3103410ec8b93bfa89410242b55e4c066c6629;hp=42753db6c64c556305b8f63baa6b7a797df1c30d;hpb=576543c90ce56ba2bf648ebe8d356d79de79883c;p=ghc-hetmet.git diff --git a/ghc/utils/ghc-pkg/Main.hs b/ghc/utils/ghc-pkg/Main.hs index 42753db..0656399 100644 --- a/ghc/utils/ghc-pkg/Main.hs +++ b/ghc/utils/ghc-pkg/Main.hs @@ -285,13 +285,15 @@ getPkgDatabases modify flags = do -- --user means overlap with the user database -- --global means reset to just the global database -- -f means overlap with - addDB dbs FlagUser = if user_conf `elem` dbs - then dbs - else user_conf : dbs + addDB dbs FlagUser + | user_conf `elem` dbs = dbs + | modify || user_exists = user_conf : dbs addDB dbs FlagGlobal = [global_conf] addDB dbs (FlagConfig f) = f : dbs addDB dbs _ = dbs + -- we create the user database iff (a) we're modifying, and (b) the + -- user asked to use it by giving the --user flag. when (not user_exists && user_conf `elem` databases) $ do putStrLn ("Creating user package database in " ++ user_conf) createDirectoryIfMissing True archdir