compiler: follow ghc convention and put conf files in package.conf.d dir (#978)

* compiler: follow ghc convention and put conf files in package.conf.d dir

We follow the ghc convention and locate all .conf files for the package
database in the `package.conf.d` dir.

* addressed neil's comment
This commit is contained in:
Robin Krom 2019-05-08 14:23:04 +02:00 committed by GitHub
parent 56d7dac830
commit 73b9de2536

View File

@ -29,6 +29,7 @@ import qualified Packages
import Platform
import qualified EnumSet
import Data.IORef
import System.FilePath
import GHC.Generics (Generic)
----------------------------------------------------------------------
@ -38,7 +39,7 @@ setPackageDbs :: [FilePath] -> DynFlags -> DynFlags
setPackageDbs paths dflags =
dflags
{ packageDBFlags =
[PackageDB $ PkgConfFile path | path <- paths] ++ [NoGlobalPackageDB, ClearPackageDBs]
[PackageDB $ PkgConfFile $ path </> "package.conf.d" | path <- paths] ++ [NoGlobalPackageDB, ClearPackageDBs]
, pkgDatabase = if null paths then Just [] else Nothing
-- if we don't load any packages set the package database to empty and loaded.
, settings = (settings dflags)