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

s/rawSystemProgram/runProgram/

parent 7fd3e3aa
......@@ -177,8 +177,8 @@ configureToolchain _implInfo ghcProg ghcInfo =
withTempFile tempDir ".o" $ \testofile testohnd -> do
hPutStrLn testchnd "int foo() { return 0; }"
hClose testchnd; hClose testohnd
rawSystemProgram verbosity ghcProg ["-c", testcfile,
"-o", testofile]
runProgram verbosity ghcProg ["-c", testcfile,
"-o", testofile]
withTempFile tempDir ".o" $ \testofile' testohnd' ->
do
hClose testohnd'
......
......@@ -153,7 +153,7 @@ haddock pkg_descr lbi suffixes flags' = do
fromFlagOrDefault ForDevelopment (haddockForHackage flags')
setupMessage verbosity "Running Haddock for" (packageId pkg_descr)
(confHaddock, version, _) <-
(haddockProg, version, _) <-
requireProgramVersion verbosity haddockProgram
(orLaterVersion (Version [2,0] [])) (withPrograms lbi)
......@@ -162,7 +162,7 @@ haddock pkg_descr lbi suffixes flags' = do
&& version < Version [2,2] []) $
die "haddock 2.0 and 2.1 do not support the --hoogle flag."
haddockGhcVersionStr <- rawSystemProgramStdout verbosity confHaddock
haddockGhcVersionStr <- rawSystemProgramStdout verbosity haddockProg
["--ghc-version"]
case (simpleParse haddockGhcVersionStr, compilerCompatVersion GHC comp) of
(Nothing, _) -> die "Could not get GHC version from Haddock"
......@@ -199,7 +199,7 @@ haddock pkg_descr lbi suffixes flags' = do
version
let exeArgs' = commonArgs `mappend` exeArgs
runHaddock verbosity tmpFileOpts comp platform
confHaddock exeArgs'
haddockProg exeArgs'
Nothing -> do
warn (fromFlag $ haddockVerbosity flags)
"Unsupported component, skipping..."
......@@ -211,7 +211,7 @@ haddock pkg_descr lbi suffixes flags' = do
libArgs <- fromLibrary verbosity tmp lbi lib clbi htmlTemplate
version
let libArgs' = commonArgs `mappend` libArgs
runHaddock verbosity tmpFileOpts comp platform confHaddock libArgs'
runHaddock verbosity tmpFileOpts comp platform haddockProg libArgs'
CExe _ -> when (flag haddockExecutables) $ doExe component
CTest _ -> when (flag haddockTestSuites) $ doExe component
CBench _ -> when (flag haddockBenchmarks) $ doExe component
......@@ -428,13 +428,13 @@ runHaddock :: Verbosity
-> ConfiguredProgram
-> HaddockArgs
-> IO ()
runHaddock verbosity tmpFileOpts comp platform confHaddock args = do
runHaddock verbosity tmpFileOpts comp platform haddockProg args = do
let haddockVersion = fromMaybe (error "unable to determine haddock version")
(programVersion confHaddock)
(programVersion haddockProg)
renderArgs verbosity tmpFileOpts haddockVersion comp platform args $
\(flags,result)-> do
rawSystemProgram verbosity confHaddock flags
runProgram verbosity haddockProg flags
notice verbosity $ "Documentation created: " ++ result
......@@ -695,13 +695,13 @@ hscolour' onNoHsColour haddockTarget pkg_descr lbi suffixes flags =
case stylesheet of -- copy the CSS file
Nothing | programVersion prog >= Just (Version [1,9] []) ->
rawSystemProgram verbosity prog
runProgram verbosity prog
["-print-css", "-o" ++ outputDir </> "hscolour.css"]
| otherwise -> return ()
Just s -> copyFileVerbose verbosity s (outputDir </> "hscolour.css")
for_ moduleFiles $ \(m, inFile) ->
rawSystemProgram verbosity prog
runProgram verbosity prog
["-css", "-anchor", "-o" ++ outFile m, inFile]
where
outFile m = outputDir </>
......
......@@ -120,7 +120,7 @@ buildLib verbosity pkg_descr lbi lib clbi = do
pfile = buildDir lbi </> "jhc-pkg.conf"
hlfile= buildDir lbi </> (pkgid ++ ".hl")
writeFileAtomic pfile . BS.Char8.pack $ jhcPkgConf pkg_descr
rawSystemProgram verbosity jhcProg $
runProgram verbosity jhcProg $
["--build-hl="++pfile, "-o", hlfile] ++
args ++ map display (libModules lib)
......@@ -133,7 +133,7 @@ buildExe verbosity _pkg_descr lbi exe clbi = do
let exeBi = buildInfo exe
let out = buildDir lbi </> exeName exe
let args = constructJHCCmdLine lbi exeBi clbi (buildDir lbi) verbosity
rawSystemProgram verbosity jhcProg (["-o",out] ++ args ++ [modulePath exe])
runProgram verbosity jhcProg (["-o",out] ++ args ++ [modulePath exe])
constructJHCCmdLine :: LocalBuildInfo -> BuildInfo -> ComponentLocalBuildInfo
-> FilePath -> Verbosity -> [String]
......
......@@ -161,7 +161,7 @@ configureToolchain lhcProg =
withTempFile tempDir ".o" $ \testofile testohnd -> do
hPutStrLn testchnd "int foo() { return 0; }"
hClose testchnd; hClose testohnd
rawSystemProgram verbosity lhcProg ["-c", testcfile,
runProgram verbosity lhcProg ["-c", testcfile,
"-o", testofile]
withTempFile tempDir ".o" $ \testofile' testohnd' ->
do
......@@ -684,7 +684,7 @@ installExe verbosity lbi installDirs buildPref (progprefix, progsuffix) _pkg exe
stripExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> IO ()
stripExe verbosity lbi name path = when (stripExes lbi) $
case lookupProgram stripProgram (withPrograms lbi) of
Just strip -> rawSystemProgram verbosity strip args
Just strip -> runProgram verbosity strip args
Nothing -> unless (buildOS == Windows) $
-- Don't bother warning on windows, we don't expect them to
-- have the strip program anyway.
......
......@@ -337,7 +337,7 @@ ppGhcCpp program xHs extraArgs _bi lbi clbi =
runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do
(prog, version, _) <- requireProgramVersion verbosity
program anyVersion (withPrograms lbi)
rawSystemProgram verbosity prog $
runProgram verbosity prog $
["-E", "-cpp"]
-- This is a bit of an ugly hack. We're going to
-- unlit the file ourselves later on if appropriate,
......@@ -357,7 +357,7 @@ ppCpphs extraArgs _bi lbi clbi =
runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity -> do
(cpphsProg, cpphsVersion, _) <- requireProgramVersion verbosity
cpphsProgram anyVersion (withPrograms lbi)
rawSystemProgram verbosity cpphsProg $
runProgram verbosity cpphsProg $
("-O" ++ outFile) : inFile
: "--noline" : "--strip"
: (if cpphsVersion >= Version [1,6] []
......@@ -465,7 +465,7 @@ ppC2hs bi lbi clbi =
c2hsProgram (orLaterVersion (Version [0,15] []))
(withPrograms lbi)
(gccProg, _) <- requireProgram verbosity gccProgram (withPrograms lbi)
rawSystemProgram verbosity c2hsProg $
runProgram verbosity c2hsProg $
-- Options from the current package:
[ "--cpp=" ++ programPath gccProg, "--cppopts=-E" ]
......
......@@ -24,7 +24,7 @@ import System.FilePath (takeBaseName)
runStrip :: Verbosity -> ProgramConfiguration -> FilePath -> [String] -> IO ()
runStrip verbosity progConf path args =
case lookupProgram stripProgram progConf of
Just strip -> rawSystemProgram verbosity strip (path:args)
Just strip -> runProgram verbosity strip (path:args)
Nothing -> unless (buildOS == Windows) $
-- Don't bother warning on windows, we don't expect them to
-- have the strip program anyway.
......
......@@ -24,7 +24,7 @@ import Distribution.Package
( packageVersion )
import Distribution.Simple.Haddock (haddockPackagePaths)
import Distribution.Simple.Program (haddockProgram, ProgramConfiguration
, rawSystemProgram, requireProgramVersion)
, runProgram, requireProgramVersion)
import Distribution.Version (Version(Version), orLaterVersion)
import Distribution.Verbosity (Verbosity)
import Distribution.Simple.PackageIndex
......@@ -57,7 +57,7 @@ regenerateHaddockIndex verbosity pkgs conf index = do
, "--title=Haskell modules on this system" ]
++ [ "--read-interface=" ++ html ++ "," ++ interface
| (interface, html) <- paths' ]
rawSystemProgram verbosity confHaddock flags
runProgram verbosity confHaddock flags
renameFile (tempDir </> "index.html") (tempDir </> destFile)
installDirectoryContents verbosity tempDir destDir
......
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