Commit 74ffaf38 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Make rendering the ghc package db stack more lenient

Allow the user package db to appear after a specific one.
No reason not to and makes some things in cabal-install more convenient.
parent 91afc9f7
......@@ -769,14 +769,15 @@ ghcOptions lbi bi clbi odir
ghcPackageDbOptions :: PackageDBStack -> [String]
ghcPackageDbOptions dbstack = case dbstack of
(GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs
(GlobalPackageDB:dbs) -> "-no-user-package-conf"
: concatMap specific dbs
_ -> ierror
(GlobalPackageDB:dbs)
| UserPackageDB `elem` dbs -> concatMap specific dbs
| otherwise -> "-no-user-package-conf"
: concatMap specific dbs
_ -> ierror
where
specific (SpecificPackageDB db) = [ "-package-conf", db ]
specific _ = ierror
ierror = error "internal error: unexpected package db stack"
specific _ = []
ierror = error "internal error: unexpected package db stack"
constructCcCmdLine :: LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo
-> FilePath -> FilePath -> Verbosity -> (FilePath,[String])
......
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