Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alex D
GHC
Commits
cf81f273
Commit
cf81f273
authored
Jun 24, 2006
by
Ian Lynagh
Browse files
Be lazier in user config creation, and don't fail on missing configs.
parent
202712d3
Changes
1
Hide whitespace changes
Inline
Side-by-side
utils/ghc-pkg/Main.hs
View file @
cf81f273
...
...
@@ -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
`
\
_
->
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment