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,13 +769,14 @@ ghcOptions lbi bi clbi odir ...@@ -769,13 +769,14 @@ ghcOptions lbi bi clbi odir
ghcPackageDbOptions :: PackageDBStack -> [String] ghcPackageDbOptions :: PackageDBStack -> [String]
ghcPackageDbOptions dbstack = case dbstack of ghcPackageDbOptions dbstack = case dbstack of
(GlobalPackageDB:UserPackageDB:dbs) -> concatMap specific dbs (GlobalPackageDB:dbs)
(GlobalPackageDB:dbs) -> "-no-user-package-conf" | UserPackageDB `elem` dbs -> concatMap specific dbs
| otherwise -> "-no-user-package-conf"
: concatMap specific dbs : concatMap specific dbs
_ -> ierror _ -> ierror
where where
specific (SpecificPackageDB db) = [ "-package-conf", db ] specific (SpecificPackageDB db) = [ "-package-conf", db ]
specific _ = ierror specific _ = []
ierror = error "internal error: unexpected package db stack" ierror = error "internal error: unexpected package db stack"
constructCcCmdLine :: LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo constructCcCmdLine :: LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo
......
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