From cf81f273637efb4e2199493814ca57d9d447f839 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Sat, 24 Jun 2006 23:08:00 +0000 Subject: [PATCH] Be lazier in user config creation, and don't fail on missing configs. --- utils/ghc-pkg/Main.hs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs index fb3ef07..3b0b438 100644 --- a/utils/ghc-pkg/Main.hs +++ b/utils/ghc-pkg/Main.hs @@ -352,19 +352,12 @@ getPkgDatabases modify flags = do in go flags - -- 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` final_stack) $ do - putStrLn ("Creating user package database in " ++ user_conf) - createDirectoryIfMissing True archdir - writeFile user_conf emptyPackageConfig - db_stack <- mapM readParseDatabase final_stack return db_stack readParseDatabase :: PackageDBName -> IO (PackageDBName,PackageDB) readParseDatabase filename = do - str <- readFile filename + str <- readFile filename `Exception.catch` \_ -> return emptyPackageConfig let packages = read str Exception.evaluate packages `Exception.catch` \_ -> -- 1.7.10.4