Commit d8ef88a9 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

s/conf/progdb/

parent a55f53d2
......@@ -275,21 +275,21 @@ getGhcInfo verbosity ghcProg = Internal.getGhcInfo verbosity implInfo ghcProg
-- | Given a single package DB, return all installed packages.
getPackageDBContents :: Verbosity -> PackageDB -> ProgramDb
-> IO InstalledPackageIndex
getPackageDBContents verbosity packagedb conf = do
pkgss <- getInstalledPackages' verbosity [packagedb] conf
toPackageIndex verbosity pkgss conf
getPackageDBContents verbosity packagedb progdb = do
pkgss <- getInstalledPackages' verbosity [packagedb] progdb
toPackageIndex verbosity pkgss progdb
-- | Given a package DB stack, return all installed packages.
getInstalledPackages :: Verbosity -> Compiler -> PackageDBStack
-> ProgramDb
-> IO InstalledPackageIndex
getInstalledPackages verbosity comp packagedbs conf = do
getInstalledPackages verbosity comp packagedbs progdb = do
checkPackageDbStack comp packagedbs
envPackageDBs <- maybe []
(map SpecificPackageDB . unintersperse searchPathSeparator)
<$> lookupEnv "GHC_PACKAGE_PATH"
pkgss <- getInstalledPackages' verbosity (envPackageDBs ++ packagedbs) conf
index <- toPackageIndex verbosity pkgss conf
pkgss <- getInstalledPackages' verbosity (envPackageDBs ++ packagedbs) progdb
index <- toPackageIndex verbosity pkgss progdb
return $! hackRtsPackage index
where
......@@ -307,7 +307,7 @@ toPackageIndex :: Verbosity
-> [(PackageDB, [InstalledPackageInfo])]
-> ProgramDb
-> IO InstalledPackageIndex
toPackageIndex verbosity pkgss conf = do
toPackageIndex verbosity pkgss progdb = do
-- On Windows, various fields have $topdir/foo rather than full
-- paths. We need to substitute the right value in so that when
-- we, for example, call gcc, we have proper paths to give it.
......@@ -317,7 +317,7 @@ toPackageIndex verbosity pkgss conf = do
return $! mconcat indices
where
Just ghcProg = lookupProgram ghcProgram conf
Just ghcProg = lookupProgram ghcProgram progdb
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
getLibDir verbosity lbi =
......@@ -394,19 +394,19 @@ removeMingwIncludeDir pkg =
--
getInstalledPackages' :: Verbosity -> [PackageDB] -> ProgramDb
-> IO [(PackageDB, [InstalledPackageInfo])]
getInstalledPackages' verbosity packagedbs conf
getInstalledPackages' verbosity packagedbs progdb
| ghcVersion >= Version [6,9] [] =
sequenceA
[ do pkgs <- HcPkg.dump (hcPkgInfo conf) verbosity packagedb
[ do pkgs <- HcPkg.dump (hcPkgInfo progdb) verbosity packagedb
return (packagedb, pkgs)
| packagedb <- packagedbs ]
where
Just ghcProg = lookupProgram ghcProgram conf
Just ghcProg = lookupProgram ghcProgram progdb
Just ghcVersion = programVersion ghcProg
getInstalledPackages' verbosity packagedbs conf = do
str <- getDbProgramOutput verbosity ghcPkgProgram conf ["list"]
getInstalledPackages' verbosity packagedbs progdb = do
str <- getDbProgramOutput verbosity ghcPkgProgram progdb ["list"]
let pkgFiles = [ init line | line <- lines str, last line == ':' ]
dbFile packagedb = case (packagedb, pkgFiles) of
(GlobalPackageDB, global:_) -> return $ Just global
......@@ -431,7 +431,7 @@ getInstalledPackages' verbosity packagedbs conf = do
-- We dropped support for 6.4.2 and earlier.
| otherwise
= \file _ -> failToRead file
Just ghcProg = lookupProgram ghcProgram conf
Just ghcProg = lookupProgram ghcProgram progdb
Just ghcVersion = programVersion ghcProg
failToRead file = die $ "cannot read ghc package database " ++ file
......@@ -755,13 +755,13 @@ buildOrReplLib forRepl verbosity numJobs pkg_descr lbi lib clbi = do
-- | Start a REPL without loading any source files.
startInterpreter :: Verbosity -> ProgramDb -> Compiler -> Platform
-> PackageDBStack -> IO ()
startInterpreter verbosity conf comp platform packageDBs = do
startInterpreter verbosity progdb comp platform packageDBs = do
let replOpts = mempty {
ghcOptMode = toFlag GhcModeInteractive,
ghcOptPackageDBs = packageDBs
}
checkPackageDbStack comp packageDBs
(ghcProg, _) <- requireProgram verbosity ghcProgram conf
(ghcProg, _) <- requireProgram verbosity ghcProgram progdb
runGHC verbosity ghcProg comp platform replOpts
-- | Build an executable with GHC.
......@@ -1189,18 +1189,18 @@ installLib verbosity lbi targetDir dynlibTargetDir _builtDir _pkg lib clbi = do
-- Registering
hcPkgInfo :: ProgramDb -> HcPkg.HcPkgInfo
hcPkgInfo conf = HcPkg.HcPkgInfo { HcPkg.hcPkgProgram = ghcPkgProg
, HcPkg.noPkgDbStack = v < [6,9]
, HcPkg.noVerboseFlag = v < [6,11]
, HcPkg.flagPackageConf = v < [7,5]
, HcPkg.supportsDirDbs = v >= [6,8]
, HcPkg.requiresDirDbs = v >= [7,10]
, HcPkg.nativeMultiInstance = v >= [7,10]
, HcPkg.recacheMultiInstance = v >= [6,12]
}
hcPkgInfo progdb = HcPkg.HcPkgInfo { HcPkg.hcPkgProgram = ghcPkgProg
, HcPkg.noPkgDbStack = v < [6,9]
, HcPkg.noVerboseFlag = v < [6,11]
, HcPkg.flagPackageConf = v < [7,5]
, HcPkg.supportsDirDbs = v >= [6,8]
, HcPkg.requiresDirDbs = v >= [7,10]
, HcPkg.nativeMultiInstance = v >= [7,10]
, HcPkg.recacheMultiInstance = v >= [6,12]
}
where
v = versionBranch ver
Just ghcPkgProg = lookupProgram ghcPkgProgram conf
Just ghcPkgProg = lookupProgram ghcPkgProgram progdb
Just ver = programVersion ghcPkgProg
registerPackage
......
......@@ -119,10 +119,10 @@ getLanguages verbosity prog = do
-- if we need something like that as well.
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramDb
-> IO InstalledPackageIndex
getInstalledPackages verbosity packagedbs conf =
getInstalledPackages verbosity packagedbs progdb =
liftM (PackageIndex.fromList . concat) $ for packagedbs $ \packagedb ->
do str <-
getDbProgramOutput verbosity haskellSuitePkgProgram conf
getDbProgramOutput verbosity haskellSuitePkgProgram progdb
["dump", packageDbOpt packagedb]
`catchExit` \_ -> die $ "pkg dump failed"
case parsePackages str of
......@@ -160,10 +160,10 @@ buildLib verbosity pkg_descr lbi lib clbi = do
srcDirs = hsSourceDirs bi ++ [odir]
dbStack = withPackageDB lbi
language = fromMaybe Haskell98 (defaultLanguage bi)
conf = withPrograms lbi
progdb = withPrograms lbi
pkgid = packageId pkg_descr
runDbProgram verbosity haskellSuiteProgram conf $
runDbProgram verbosity haskellSuiteProgram progdb $
[ "compile", "--build-dir", odir ] ++
concat [ ["-i", d] | d <- srcDirs ] ++
concat [ ["-I", d] | d <- [autogenComponentModulesDir lbi clbi
......@@ -191,8 +191,8 @@ installLib
-> ComponentLocalBuildInfo
-> IO ()
installLib verbosity lbi targetDir dynlibTargetDir builtDir pkg lib _clbi = do
let conf = withPrograms lbi
runDbProgram verbosity haskellSuitePkgProgram conf $
let progdb = withPrograms lbi
runDbProgram verbosity haskellSuitePkgProgram progdb $
[ "install-library"
, "--build-dir", builtDir
, "--target-dir", targetDir
......@@ -215,8 +215,8 @@ registerPackage verbosity progdb packageDbs installedPkgInfo = do
{ progInvokeInput = Just $ showInstalledPackageInfo installedPkgInfo }
initPackageDB :: Verbosity -> ProgramDb -> FilePath -> IO ()
initPackageDB verbosity conf dbPath =
runDbProgram verbosity haskellSuitePkgProgram conf
initPackageDB verbosity progdb dbPath =
runDbProgram verbosity haskellSuitePkgProgram progdb
["init", dbPath]
packageDbOpt :: PackageDB -> String
......
......@@ -50,11 +50,11 @@ import qualified Data.ByteString.Lazy.Char8 as BS.Char8
configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)
configure verbosity hcPath _hcPkgPath conf = do
configure verbosity hcPath _hcPkgPath progdb = do
(jhcProg, _, conf') <- requireProgramVersion verbosity
(jhcProg, _, progdb') <- requireProgramVersion verbosity
jhcProgram (orLaterVersion (Version [0,7,2] []))
(userMaybeSpecifyPath "jhc" hcPath conf)
(userMaybeSpecifyPath "jhc" hcPath progdb)
let Just version = programVersion jhcProg
comp = Compiler {
......@@ -66,7 +66,7 @@ configure verbosity hcPath _hcPkgPath conf = do
compilerProperties = Map.empty
}
compPlatform = Nothing
return (comp, compPlatform, conf')
return (comp, compPlatform, progdb')
jhcLanguages :: [(Language, Flag)]
jhcLanguages = [(Haskell98, "")]
......@@ -86,11 +86,11 @@ jhcLanguageExtensions =
getInstalledPackages :: Verbosity -> PackageDBStack -> ProgramDb
-> IO InstalledPackageIndex
getInstalledPackages verbosity _packageDBs conf = do
getInstalledPackages verbosity _packageDBs progdb = do
-- jhc --list-libraries lists all available libraries.
-- How shall I find out, whether they are global or local
-- without checking all files and locations?
str <- getDbProgramOutput verbosity jhcProgram conf ["--list-libraries"]
str <- getDbProgramOutput verbosity jhcProgram progdb ["--list-libraries"]
let pCheck :: [(a, String)] -> [a]
pCheck rs = [ r | (r,s) <- rs, all isSpace s ]
let parseLine ln =
......
......@@ -103,13 +103,13 @@ defaultProgramDb = restoreProgramDb builtinPrograms emptyProgramDb
-- internal helpers:
updateUnconfiguredProgs :: (UnconfiguredProgs -> UnconfiguredProgs)
-> ProgramDb -> ProgramDb
updateUnconfiguredProgs update conf =
conf { unconfiguredProgs = update (unconfiguredProgs conf) }
updateUnconfiguredProgs update progdb =
progdb { unconfiguredProgs = update (unconfiguredProgs progdb) }
updateConfiguredProgs :: (ConfiguredProgs -> ConfiguredProgs)
-> ProgramDb -> ProgramDb
updateConfiguredProgs update conf =
conf { configuredProgs = update (configuredProgs conf) }
updateConfiguredProgs update progdb =
progdb { configuredProgs = update (configuredProgs progdb) }
-- Read & Show instances are based on listToFM
......@@ -169,7 +169,7 @@ addKnownProgram prog = updateUnconfiguredProgs $
addKnownPrograms :: [Program] -> ProgramDb -> ProgramDb
addKnownPrograms progs conf = foldl' (flip addKnownProgram) conf progs
addKnownPrograms progs progdb = foldl' (flip addKnownProgram) progdb progs
lookupKnownProgram :: String -> ProgramDb -> Maybe Program
......@@ -178,9 +178,9 @@ lookupKnownProgram name =
knownPrograms :: ProgramDb -> [(Program, Maybe ConfiguredProgram)]
knownPrograms conf =
[ (p,p') | (p,_,_) <- Map.elems (unconfiguredProgs conf)
, let p' = Map.lookup (programName p) (configuredProgs conf) ]
knownPrograms progdb =
[ (p,p') | (p,_,_) <- Map.elems (unconfiguredProgs progdb)
, let p' = Map.lookup (programName p) (configuredProgs progdb) ]
-- | Get the current 'ProgramSearchPath' used by the 'ProgramDb'.
-- This is the default list of locations where programs are looked for when
......@@ -221,8 +221,8 @@ userSpecifyPath name path = updateUnconfiguredProgs $
userMaybeSpecifyPath :: String -> Maybe FilePath
-> ProgramDb -> ProgramDb
userMaybeSpecifyPath _ Nothing conf = conf
userMaybeSpecifyPath name (Just path) conf = userSpecifyPath name path conf
userMaybeSpecifyPath _ Nothing progdb = progdb
userMaybeSpecifyPath name (Just path) progdb = userSpecifyPath name path progdb
-- |User-specify the arguments for this program. Basically override
......@@ -247,8 +247,8 @@ userSpecifyArgs name args' =
userSpecifyPaths :: [(String, FilePath)]
-> ProgramDb
-> ProgramDb
userSpecifyPaths paths conf =
foldl' (\conf' (prog, path) -> userSpecifyPath prog path conf') conf paths
userSpecifyPaths paths progdb =
foldl' (\conf' (prog, path) -> userSpecifyPath prog path conf') progdb paths
-- | Like 'userSpecifyPath' but for a list of progs and their args.
......@@ -256,8 +256,8 @@ userSpecifyPaths paths conf =
userSpecifyArgss :: [(String, [ProgArg])]
-> ProgramDb
-> ProgramDb
userSpecifyArgss argss conf =
foldl' (\conf' (prog, args) -> userSpecifyArgs prog args conf') conf argss
userSpecifyArgss argss progdb =
foldl' (\conf' (prog, args) -> userSpecifyArgs prog args conf') progdb argss
-- | Get the path that has been previously specified for a program, if any.
......@@ -314,17 +314,17 @@ configureProgram :: Verbosity
-> Program
-> ProgramDb
-> IO ProgramDb
configureProgram verbosity prog conf = do
configureProgram verbosity prog progdb = do
let name = programName prog
maybeLocation <- case userSpecifiedPath prog conf of
maybeLocation <- case userSpecifiedPath prog progdb of
Nothing ->
programFindLocation prog verbosity (progSearchPath conf)
programFindLocation prog verbosity (progSearchPath progdb)
>>= return . fmap (swap . fmap FoundOnSystem . swap)
Just path -> do
absolute <- doesExecutableExist path
if absolute
then return (Just (UserSpecified path, []))
else findProgramOnSearchPath verbosity (progSearchPath conf) path
else findProgramOnSearchPath verbosity (progSearchPath progdb) path
>>= maybe (die notFound)
(return . Just . swap . fmap UserSpecified . swap)
where notFound = "Cannot find the program '" ++ name
......@@ -332,22 +332,22 @@ configureProgram verbosity prog conf = do
++ path ++ "' does not refer to an executable and "
++ "the program is not on the system path."
case maybeLocation of
Nothing -> return conf
Nothing -> return progdb
Just (location, triedLocations) -> do
version <- programFindVersion prog verbosity (locationPath location)
newPath <- programSearchPathAsPATHVar (progSearchPath conf)
newPath <- programSearchPathAsPATHVar (progSearchPath progdb)
let configuredProg = ConfiguredProgram {
programId = name,
programVersion = version,
programDefaultArgs = [],
programOverrideArgs = userSpecifiedArgs prog conf,
programOverrideArgs = userSpecifiedArgs prog progdb,
programOverrideEnv = [("PATH", Just newPath)],
programProperties = Map.empty,
programLocation = location,
programMonitorFiles = triedLocations
}
configuredProg' <- programPostConf prog verbosity configuredProg
return (updateConfiguredProgs (Map.insert name configuredProg') conf)
return (updateConfiguredProgs (Map.insert name configuredProg') progdb)
-- | Configure a bunch of programs using 'configureProgram'. Just a 'foldM'.
......@@ -356,8 +356,8 @@ configurePrograms :: Verbosity
-> [Program]
-> ProgramDb
-> IO ProgramDb
configurePrograms verbosity progs conf =
foldM (flip (configureProgram verbosity)) conf progs
configurePrograms verbosity progs progdb =
foldM (flip (configureProgram verbosity)) progdb progs
-- | Try to configure all the known programs that have not yet been configured.
......@@ -365,12 +365,12 @@ configurePrograms verbosity progs conf =
configureAllKnownPrograms :: Verbosity
-> ProgramDb
-> IO ProgramDb
configureAllKnownPrograms verbosity conf =
configureAllKnownPrograms verbosity progdb =
configurePrograms verbosity
[ prog | (prog,_,_) <- Map.elems notYetConfigured ] conf
[ prog | (prog,_,_) <- Map.elems notYetConfigured ] progdb
where
notYetConfigured = unconfiguredProgs conf
`Map.difference` configuredProgs conf
notYetConfigured = unconfiguredProgs progdb
`Map.difference` configuredProgs progdb
-- | reconfigure a bunch of programs given new user-specified args. It takes
......@@ -382,14 +382,14 @@ reconfigurePrograms :: Verbosity
-> [(String, [ProgArg])]
-> ProgramDb
-> IO ProgramDb
reconfigurePrograms verbosity paths argss conf = do
reconfigurePrograms verbosity paths argss progdb = do
configurePrograms verbosity progs
. userSpecifyPaths paths
. userSpecifyArgss argss
$ conf
$ progdb
where
progs = catMaybes [ lookupKnownProgram name conf | (name,_) <- paths ]
progs = catMaybes [ lookupKnownProgram name progdb | (name,_) <- paths ]
-- | Check that a program is configured and available to be run.
......@@ -399,12 +399,12 @@ reconfigurePrograms verbosity paths argss conf = do
--
requireProgram :: Verbosity -> Program -> ProgramDb
-> IO (ConfiguredProgram, ProgramDb)
requireProgram verbosity prog conf = do
requireProgram verbosity prog progdb = do
-- If it's not already been configured, try to configure it now
conf' <- case lookupProgram prog conf of
Nothing -> configureProgram verbosity prog conf
Just _ -> return conf
conf' <- case lookupProgram prog progdb of
Nothing -> configureProgram verbosity prog progdb
Just _ -> return progdb
case lookupProgram prog conf' of
Nothing -> die notFound
......
......@@ -33,8 +33,8 @@ runStrip verbosity progDb path args =
++ "' (missing the 'strip' program)"
stripExe :: Verbosity -> Platform -> ProgramDb -> FilePath -> IO ()
stripExe verbosity (Platform _arch os) conf path =
runStrip verbosity conf path args
stripExe verbosity (Platform _arch os) progdb path =
runStrip verbosity progdb path args
where
args = case os of
OSX -> ["-x"] -- By default, stripping the ghc binary on at least
......@@ -44,7 +44,7 @@ stripExe verbosity (Platform _arch os) conf path =
_ -> []
stripLib :: Verbosity -> Platform -> ProgramDb -> FilePath -> IO ()
stripLib verbosity (Platform arch os) conf path = do
stripLib verbosity (Platform arch os) progdb path = do
case os of
OSX -> -- '--strip-unneeded' is not supported on OS X, iOS, AIX, or
-- Solaris. See #1630.
......@@ -60,13 +60,13 @@ stripLib verbosity (Platform arch os) conf path = do
-- Versions of 'strip' on 32-bit Linux older than 2.18 are
-- broken. See #2339.
let okVersion = orLaterVersion (Version [2,18] [])
in case programVersion =<< lookupProgram stripProgram conf of
in case programVersion =<< lookupProgram stripProgram progdb of
Just v | withinRange v okVersion ->
runStrip verbosity conf path args
runStrip verbosity progdb path args
_ -> warn verbosity $ "Unable to strip library '"
++ (takeBaseName path)
++ "' (version of 'strip' too old; "
++ "requires >= 2.18 on 32-bit Linux)"
_ -> runStrip verbosity conf path args
_ -> runStrip verbosity progdb path args
where
args = ["--strip-unneeded"]
......@@ -87,11 +87,11 @@ freeze :: Verbosity
-> GlobalFlags
-> FreezeFlags
-> IO ()
freeze verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
freeze verbosity packageDBs repoCtxt comp platform progdb mSandboxPkgInfo
globalFlags freezeFlags = do
pkgs <- getFreezePkgs
verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
verbosity packageDBs repoCtxt comp platform progdb mSandboxPkgInfo
globalFlags freezeFlags
if null pkgs
......@@ -119,12 +119,12 @@ getFreezePkgs :: Verbosity
-> GlobalFlags
-> FreezeFlags
-> IO [SolverPlanPackage]
getFreezePkgs verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
getFreezePkgs verbosity packageDBs repoCtxt comp platform progdb mSandboxPkgInfo
globalFlags freezeFlags = do
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs progdb
sourcePkgDb <- getSourcePackages verbosity repoCtxt
pkgConfigDb <- readPkgConfigDb verbosity conf
pkgConfigDb <- readPkgConfigDb verbosity progdb
pkgSpecifiers <- resolveUserTargets verbosity repoCtxt
(fromFlag $ globalWorldFile globalFlags)
......
......@@ -101,7 +101,7 @@ genBounds
-> GlobalFlags
-> FreezeFlags
-> IO ()
genBounds verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
genBounds verbosity packageDBs repoCtxt comp platform progdb mSandboxPkgInfo
globalFlags freezeFlags = do
let cinfo = compilerInfo comp
......@@ -126,7 +126,7 @@ genBounds verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
where
go needBounds = do
pkgs <- getFreezePkgs
verbosity packageDBs repoCtxt comp platform conf
verbosity packageDBs repoCtxt comp platform progdb
mSandboxPkgInfo globalFlags freezeFlags
putStrLn boundsNeededMsg
......
......@@ -38,14 +38,14 @@ regenerateHaddockIndex :: Verbosity
-> InstalledPackageIndex -> ProgramDb
-> FilePath
-> IO ()
regenerateHaddockIndex verbosity pkgs conf index = do
regenerateHaddockIndex verbosity pkgs progdb index = do
(paths, warns) <- haddockPackagePaths pkgs' Nothing
let paths' = [ (interface, html) | (interface, Just html) <- paths]
forM_ warns (debug verbosity)
(confHaddock, _, _) <-
requireProgramVersion verbosity haddockProgram
(orLaterVersion (Version [0,6] [])) conf
(orLaterVersion (Version [0,6] [])) progdb
createDirectoryIfMissing True destDir
......
......@@ -104,8 +104,8 @@ import qualified Hackage.Security.Util.Some as Sec
getInstalledPackages :: Verbosity -> Compiler
-> PackageDBStack -> ProgramDb
-> IO InstalledPackageIndex
getInstalledPackages verbosity comp packageDbs conf =
Configure.getInstalledPackages verbosity' comp packageDbs conf
getInstalledPackages verbosity comp packageDbs progdb =
Configure.getInstalledPackages verbosity' comp packageDbs progdb
where
verbosity' = lessVerbose verbosity
......
......@@ -112,9 +112,9 @@ initCabal :: Verbosity
-> ProgramDb
-> InitFlags
-> IO ()
initCabal verbosity packageDBs repoCtxt comp conf initFlags = do
initCabal verbosity packageDBs repoCtxt comp progdb initFlags = do
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs progdb
sourcePkgDb <- getSourcePackages verbosity repoCtxt
hSetBuffering stdout NoBuffering
......
......@@ -211,7 +211,7 @@ install
-> HaddockFlags
-> [UserTarget]
-> IO ()
install verbosity packageDBs repos comp platform conf useSandbox mSandboxPkgInfo
install verbosity packageDBs repos comp platform progdb useSandbox mSandboxPkgInfo
globalFlags configFlags configExFlags installFlags haddockFlags
userTargets0 = do
......@@ -235,9 +235,9 @@ install verbosity packageDBs repos comp platform conf useSandbox mSandboxPkgInfo
processInstallPlan verbosity args installContext installPlan
where
args :: InstallArgs
args = (packageDBs, repos, comp, platform, conf, useSandbox, mSandboxPkgInfo,
globalFlags, configFlags, configExFlags, installFlags,
haddockFlags)
args = (packageDBs, repos, comp, platform, progdb, useSandbox,
mSandboxPkgInfo, globalFlags, configFlags, configExFlags,
installFlags, haddockFlags)
die' message = die (message ++ if isUseSandbox useSandbox
then installFailedInSandbox else [])
......@@ -276,12 +276,12 @@ type InstallArgs = ( PackageDBStack
makeInstallContext :: Verbosity -> InstallArgs -> Maybe [UserTarget]
-> IO InstallContext
makeInstallContext verbosity
(packageDBs, repoCtxt, comp, _, conf,_,_,
(packageDBs, repoCtxt, comp, _, progdb,_,_,
globalFlags, _, configExFlags, _, _) mUserTargets = do
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs progdb
sourcePkgDb <- getSourcePackages verbosity repoCtxt
pkgConfigDb <- readPkgConfigDb verbosity conf
pkgConfigDb <- readPkgConfigDb verbosity progdb
checkConfigExFlags verbosity installedPkgIndex
(packageIndex sourcePkgDb) configExFlags
......@@ -810,7 +810,7 @@ postInstallActions :: Verbosity
-> BuildOutcomes
-> IO ()
postInstallActions verbosity
(packageDBs, _, comp, platform, conf, useSandbox, mSandboxPkgInfo
(packageDBs, _, comp, platform, progdb, useSandbox, mSandboxPkgInfo
,globalFlags, configFlags, _, installFlags, _)
targets installPlan buildOutcomes = do
......@@ -831,7 +831,7 @@ postInstallActions verbosity
when (reportingLevel == DetailedReports) $
storeDetailedBuildReports verbosity logsDir buildReports
regenerateHaddockIndex verbosity packageDBs comp platform conf useSandbox
regenerateHaddockIndex verbosity packageDBs comp platform progdb useSandbox
configFlags installFlags buildOutcomes
symlinkBinaries verbosity platform comp configFlags installFlags
......@@ -892,7 +892,7 @@ regenerateHaddockIndex :: Verbosity
-> InstallFlags
-> BuildOutcomes
-> IO ()
regenerateHaddockIndex verbosity packageDBs comp platform conf useSandbox
regenerateHaddockIndex verbosity packageDBs comp platform progdb useSandbox
configFlags installFlags buildOutcomes
| haddockIndexFileIsRequested && shouldRegenerateHaddockIndex = do
......@@ -907,8 +907,8 @@ regenerateHaddockIndex verbosity packageDBs comp platform conf useSandbox
"Updating documentation index " ++ indexFile
--TODO: might be nice if the install plan gave us the new InstalledPackageInfo
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs conf
Haddock.regenerateHaddockIndex verbosity installedPkgIndex conf indexFile
installedPkgIndex <- getInstalledPackages verbosity comp packageDBs progdb
Haddock.regenerateHaddockIndex verbosity installedPkgIndex progdb indexFile
| otherwise = return ()
where
......@@ -1063,7 +1063,7 @@ performInstallations :: Verbosity
-> InstallPlan
-> IO BuildOutcomes
performInstallations verbosity
(packageDBs, repoCtxt, comp, platform, conf, useSandbox, _,
(packageDBs, repoCtxt, comp, platform, progdb, useSandbox, _,
globalFlags, configFlags, configExFlags, installFlags, haddockFlags)