Commit 026466ad authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Rename PackageDb to PackageDatabase

parent 97d37ea6
......@@ -32,7 +32,7 @@ executable hadrian
, Oracles.LookupInPath
, Oracles.ModuleFiles
, Oracles.PackageData
, Oracles.PackageDb
, Oracles.PackageDatabase
, Oracles.WindowsPath
, Package
, Predicate
......
module Oracles.PackageDb (packageDbOracle) where
module Oracles.PackageDatabase (packageDatabaseOracle) where
import qualified System.Directory as IO
......@@ -12,9 +12,9 @@ import Settings.Paths
import Settings.User
import Target
packageDbOracle :: Rules ()
packageDbOracle = void $
addOracle $ \(PackageDbKey stage) -> do
packageDatabaseOracle :: Rules ()
packageDatabaseOracle = void $
addOracle $ \(PackageDatabaseKey stage) -> do
let dir = packageDbDirectory stage
file = dir -/- "package.cache"
unlessM (liftIO $ IO.doesFileExist file) $ do
......
module Rules.Oracles (oracleRules) where
import Base
import qualified Oracles.ArgsHash
import qualified Oracles.Config
import qualified Oracles.Dependencies
import qualified Oracles.LookupInPath
import qualified Oracles.ModuleFiles
import qualified Oracles.PackageData
import qualified Oracles.PackageDatabase
import qualified Oracles.WindowsPath
import qualified Oracles.ArgsHash
import qualified Oracles.ModuleFiles
import qualified Oracles.PackageDb
oracleRules :: Rules ()
oracleRules = do
......@@ -18,5 +18,5 @@ oracleRules = do
Oracles.LookupInPath.lookupInPathOracle
Oracles.ModuleFiles.moduleFilesOracle
Oracles.PackageData.packageDataOracle
Oracles.PackageDb.packageDbOracle
Oracles.PackageDatabase.packageDatabaseOracle
Oracles.WindowsPath.windowsPathOracle
......@@ -118,7 +118,7 @@ packageGhcArgs = do
return $ if not0 || unit then "-this-unit-id " else "-this-package-key "
mconcat [ arg "-hide-all-packages"
, arg "-no-user-package-db"
, bootPackageDbArgs
, bootPackageDatabaseArgs
, isLibrary pkg ? arg (thisArg ++ compId)
, append $ map ("-package-id " ++) pkgDepIds ]
......
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module Settings.Builders.GhcCabal (
ghcCabalBuilderArgs, ghcCabalHsColourBuilderArgs, bootPackageDbArgs,
PackageDbKey (..), cppArgs, buildDll0
ghcCabalBuilderArgs, ghcCabalHsColourBuilderArgs, bootPackageDatabaseArgs,
PackageDatabaseKey (..), cppArgs, buildDll0
) where
import Base
......@@ -23,7 +23,7 @@ ghcCabalBuilderArgs = builder GhcCabal ? do
, dll0Args
, withStaged $ Ghc Compile
, withStaged GhcPkg
, bootPackageDbArgs
, bootPackageDatabaseArgs
, libraryArgs
, with HsColour
, configureArgs
......@@ -81,16 +81,16 @@ configureArgs = do
, crossCompiling ? (conf "--host" $ argSetting TargetPlatformFull)
, conf "--with-cc" $ argStagedBuilderPath (Cc Compile) ]
newtype PackageDbKey = PackageDbKey Stage
deriving (Show, Typeable, Eq, Hashable, Binary, NFData)
newtype PackageDatabaseKey = PackageDatabaseKey Stage
deriving (Binary, Eq, Hashable, NFData, Show, Typeable)
initialisePackageDb :: Stage -> Action ()
initialisePackageDb stage = askOracle $ PackageDbKey stage
initialisePackageDatabase :: Stage -> Action ()
initialisePackageDatabase = askOracle . PackageDatabaseKey
bootPackageDbArgs :: Args
bootPackageDbArgs = do
bootPackageDatabaseArgs :: Args
bootPackageDatabaseArgs = do
stage <- getStage
lift $ initialisePackageDb stage
lift $ initialisePackageDatabase stage
stage0 ? do
path <- getTopDirectory
prefix <- ifM (builder Ghc) (return "-package-db ") (return "--package-db=")
......
......@@ -14,12 +14,12 @@ initPredicate = orM $ map (output . packageDbDirectory) [Stage0 ..]
initArgs :: Args
initArgs = initPredicate ? mconcat [ arg "init", arg =<< getOutput ]
-- TODO: move inplace-pkg-config to buildRootPath, see #113.
-- TODO: Move inplace-pkg-config to buildRootPath, see #113.
updateArgs :: Args
updateArgs = notM initPredicate ? do
pkg <- getPackage
dir <- getContextDirectory
mconcat [ arg "update"
, arg "--force"
, bootPackageDbArgs
, bootPackageDatabaseArgs
, arg $ pkgPath pkg -/- dir -/- "inplace-pkg-config" ]
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