Commit 0e310341 authored by simonmar's avatar simonmar
Browse files

[project @ 2005-03-16 10:24:47 by simonmar]

Further to previous patch: only create the user database if we're modifying
parent 576543c9
...@@ -285,13 +285,15 @@ getPkgDatabases modify flags = do ...@@ -285,13 +285,15 @@ getPkgDatabases modify flags = do
-- --user means overlap with the user database -- --user means overlap with the user database
-- --global means reset to just the global database -- --global means reset to just the global database
-- -f <file> means overlap with <file> -- -f <file> means overlap with <file>
addDB dbs FlagUser = if user_conf `elem` dbs addDB dbs FlagUser
then dbs | user_conf `elem` dbs = dbs
else user_conf : dbs | modify || user_exists = user_conf : dbs
addDB dbs FlagGlobal = [global_conf] addDB dbs FlagGlobal = [global_conf]
addDB dbs (FlagConfig f) = f : dbs addDB dbs (FlagConfig f) = f : dbs
addDB dbs _ = 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 when (not user_exists && user_conf `elem` databases) $ do
putStrLn ("Creating user package database in " ++ user_conf) putStrLn ("Creating user package database in " ++ user_conf)
createDirectoryIfMissing True archdir createDirectoryIfMissing True archdir
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment