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

Some final renamings...

parent a0c4f546
......@@ -383,7 +383,7 @@ configure (pkg_descr0', pbi) cfg = do
(flagToMaybe (configHcFlavor cfg))
(flagToMaybe (configHcPath cfg))
(flagToMaybe (configHcPkg cfg))
(mkProgramsConfig cfg (configPrograms cfg))
(mkProgramDb cfg (configPrograms cfg))
(lessVerbose verbosity)
-- The InstalledPackageIndex of all installed packages
......@@ -781,14 +781,14 @@ configure (pkg_descr0', pbi) cfg = do
where
verbosity = fromFlag (configVerbosity cfg)
mkProgramsConfig :: ConfigFlags -> ProgramDb -> ProgramDb
mkProgramsConfig cfg initialProgramsConfig = programDb
mkProgramDb :: ConfigFlags -> ProgramDb -> ProgramDb
mkProgramDb cfg initialProgramDb = programDb
where
programDb = userSpecifyArgss (configProgramArgs cfg)
. userSpecifyPaths (configProgramPaths cfg)
. setProgramSearchPath searchpath
$ initialProgramsConfig
searchpath = getProgramSearchPath (initialProgramsConfig)
$ initialProgramDb
searchpath = getProgramSearchPath (initialProgramDb)
++ map ProgramSearchPathDir
(fromNubList $ configProgramPathExtra cfg)
......@@ -1528,7 +1528,7 @@ configCompilerAuxEx cfg = configCompilerEx (flagToMaybe $ configHcFlavor cfg)
programDb
(fromFlag (configVerbosity cfg))
where
programDb = mkProgramsConfig cfg defaultProgramDb
programDb = mkProgramDb cfg defaultProgramDb
configCompilerEx :: Maybe CompilerFlavor -> Maybe FilePath -> Maybe FilePath
-> ProgramDb -> Verbosity
......
......@@ -105,7 +105,7 @@ configure :: Verbosity -> Maybe FilePath -> Maybe FilePath
-> IO (Compiler, Maybe Platform, ProgramDb)
configure verbosity hcPath hcPkgPath conf0 = do
(ghcProg, ghcVersion, conf1) <-
(ghcProg, ghcVersion, progdb1) <-
requireProgramVersion verbosity ghcProgram
(orLaterVersion (Version [6,11] []))
(userMaybeSpecifyPath "ghc" hcPath conf0)
......@@ -114,11 +114,11 @@ configure verbosity hcPath hcPkgPath conf0 = do
-- This is slightly tricky, we have to configure ghc first, then we use the
-- location of ghc to help find ghc-pkg in the case that the user did not
-- specify the location of ghc-pkg directly:
(ghcPkgProg, ghcPkgVersion, conf2) <-
(ghcPkgProg, ghcPkgVersion, progdb2) <-
requireProgramVersion verbosity ghcPkgProgram {
programFindLocation = guessGhcPkgFromGhcPath ghcProg
}
anyVersion (userMaybeSpecifyPath "ghc-pkg" hcPkgPath conf1)
anyVersion (userMaybeSpecifyPath "ghc-pkg" hcPkgPath progdb1)
when (ghcVersion /= ghcPkgVersion) $ die $
"Version mismatch between ghc and ghc-pkg: "
......@@ -135,9 +135,9 @@ configure verbosity hcPath hcPkgPath conf0 = do
hpcProgram' = hpcProgram {
programFindLocation = guessHpcFromGhcPath ghcProg
}
conf3 = addKnownProgram haddockProgram' $
progdb3 = addKnownProgram haddockProgram' $
addKnownProgram hsc2hsProgram' $
addKnownProgram hpcProgram' conf2
addKnownProgram hpcProgram' progdb2
languages <- Internal.getLanguages verbosity implInfo ghcProg
extensions0 <- Internal.getExtensions verbosity implInfo ghcProg
......@@ -165,8 +165,8 @@ configure verbosity hcPath hcPkgPath conf0 = do
}
compPlatform = Internal.targetPlatform ghcInfo
-- configure gcc and ld
conf4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap conf3
return (comp, compPlatform, conf4)
progdb4 = Internal.configureToolchain implInfo ghcProg ghcInfoMap progdb3
return (comp, compPlatform, progdb4)
-- | Given something like /usr/local/bin/ghc-6.6.1(.exe) we try and find
-- the corresponding tool; e.g. if the tool is ghc-pkg, we try looking
......
......@@ -25,7 +25,7 @@ import Distribution.Simple.Program.Builtin
configure
:: Verbosity -> Maybe FilePath -> Maybe FilePath
-> ProgramDb -> IO (Compiler, Maybe Platform, ProgramDb)
configure verbosity mbHcPath hcPkgPath conf0 = do
configure verbosity mbHcPath hcPkgPath progdb0 = do
-- We have no idea how a haskell-suite tool is named, so we require at
-- least some information from the user.
......@@ -36,23 +36,23 @@ configure verbosity mbHcPath hcPkgPath conf0 = do
when (isJust hcPkgPath) $
warn verbosity "--with-hc-pkg option is ignored for haskell-suite"
(comp, confdCompiler, conf1) <- configureCompiler hcPath conf0
(comp, confdCompiler, progdb1) <- configureCompiler hcPath progdb0
-- Update our pkg tool. It uses the same executable as the compiler, but
-- all command start with "pkg"
(confdPkg, _) <- requireProgram verbosity haskellSuitePkgProgram conf1
let conf2 =
(confdPkg, _) <- requireProgram verbosity haskellSuitePkgProgram progdb1
let progdb2 =
updateProgram
confdPkg
{ programLocation = programLocation confdCompiler
, programDefaultArgs = ["pkg"]
}
conf1
progdb1
return (comp, Nothing, conf2)
return (comp, Nothing, progdb2)
where
configureCompiler hcPath conf0' = do
configureCompiler hcPath progdb0' = do
let
haskellSuiteProgram' =
haskellSuiteProgram
......@@ -61,8 +61,8 @@ configure verbosity mbHcPath hcPkgPath conf0 = do
-- NB: cannot call requireProgram right away — it'd think that
-- the program is already configured and won't reconfigure it again.
-- Instead, call configureProgram directly first.
conf1 <- configureProgram verbosity haskellSuiteProgram' conf0'
(confdCompiler, conf2) <- requireProgram verbosity haskellSuiteProgram' conf1
progdb1 <- configureProgram verbosity haskellSuiteProgram' progdb0'
(confdCompiler, progdb2) <- requireProgram verbosity haskellSuiteProgram' progdb1
extensions <- getExtensions verbosity confdCompiler
languages <- getLanguages verbosity confdCompiler
......@@ -79,7 +79,7 @@ configure verbosity mbHcPath hcPkgPath conf0 = do
compilerProperties = Map.empty
}
return (comp, confdCompiler, conf2)
return (comp, confdCompiler, progdb2)
hstoolVersion :: Verbosity -> FilePath -> IO (Maybe Version)
hstoolVersion = findProgramVersion "--hspkg-version" id
......
......@@ -2142,15 +2142,15 @@ configureArgs bcHack flags
configureCCompiler :: Verbosity -> ProgramDb
-> IO (FilePath, [String])
configureCCompiler verbosity lbi = configureProg verbosity lbi gccProgram
configureCCompiler verbosity progdb = configureProg verbosity progdb gccProgram
configureLinker :: Verbosity -> ProgramDb -> IO (FilePath, [String])
configureLinker verbosity lbi = configureProg verbosity lbi ldProgram
configureLinker verbosity progdb = configureProg verbosity progdb ldProgram
configureProg :: Verbosity -> ProgramDb -> Program
-> IO (FilePath, [String])
configureProg verbosity programConfig prog = do
(p, _) <- requireProgram verbosity prog programConfig
configureProg verbosity programDb prog = do
(p, _) <- requireProgram verbosity prog programDb
let pInv = programInvocation p []
return (progInvokePath pInv, progInvokeArgs pInv)
......
......@@ -115,7 +115,7 @@ main = do
<- configCompilerEx
(Just GHC) mb_ghc_path mb_ghc_pkg_path
-- NB: if we accept full ConfigFlags parser then
-- should use (mkProgramsConfig cfg (configPrograms cfg))
-- should use (mkProgramDb cfg (configPrograms cfg))
-- instead.
defaultProgramDb
(lessVerbose verbosity)
......
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