Commit 755d059d authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

s/rawSystemStdoutConf/getDbProgramOutput/

parent ce387ae1
......@@ -1432,7 +1432,7 @@ configurePkgconfigPackages verbosity pkg_descr conf
where
allpkgs = concatMap pkgconfigDepends (allBuildInfo pkg_descr)
pkgconfig = rawSystemProgramStdoutConf (lessVerbose verbosity)
pkgconfig = getDbProgramOutput (lessVerbose verbosity)
pkgConfigProgram conf
requirePkg dep@(Dependency (PackageName pkg) range) = do
......@@ -1493,8 +1493,8 @@ configurePkgconfigPackages verbosity pkg_descr conf
-- and similar package-specific programs like mysql-config, freealut-config etc.
-- For example:
--
-- > ccflags <- rawSystemProgramStdoutConf verbosity prog conf ["--cflags"]
-- > ldflags <- rawSystemProgramStdoutConf verbosity prog conf ["--libs"]
-- > ccflags <- getDbProgramOutput verbosity prog progdb ["--cflags"]
-- > ldflags <- getDbProgramOutput verbosity prog progdb ["--libs"]
-- > return (ccldOptionsBuildInfo (words ccflags) (words ldflags))
--
ccLdOptionsBuildInfo :: [String] -> [String] -> BuildInfo
......@@ -2139,7 +2139,7 @@ checkForeignDeps pkg lbi verbosity = do
hPutStrLn cHnd program
hClose cHnd
hClose oHnd
_ <- rawSystemProgramStdoutConf verbosity
_ <- getDbProgramOutput verbosity
gccProgram (withPrograms lbi) (cName:"-o":oNname:args)
return True
`catchIO` (\_ -> return False)
......
......@@ -322,7 +322,7 @@ toPackageIndex verbosity pkgss conf = do
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
getLibDir verbosity lbi =
dropWhileEndLE isSpace `fmap`
rawSystemProgramStdoutConf verbosity ghcProgram
getDbProgramOutput verbosity ghcProgram
(withPrograms lbi) ["--print-libdir"]
getLibDir' :: Verbosity -> ConfiguredProgram -> IO FilePath
......@@ -406,7 +406,7 @@ getInstalledPackages' verbosity packagedbs conf
Just ghcVersion = programVersion ghcProg
getInstalledPackages' verbosity packagedbs conf = do
str <- rawSystemProgramStdoutConf verbosity ghcPkgProgram conf ["list"]
str <- getDbProgramOutput verbosity ghcPkgProgram conf ["list"]
let pkgFiles = [ init line | line <- lines str, last line == ':' ]
dbFile packagedb = case (packagedb, pkgFiles) of
(GlobalPackageDB, global:_) -> return $ Just global
......
......@@ -236,7 +236,7 @@ getInstalledPackages' verbosity packagedbs conf =
getLibDir :: Verbosity -> LocalBuildInfo -> IO FilePath
getLibDir verbosity lbi =
(reverse . dropWhile isSpace . reverse) `fmap`
rawSystemProgramStdoutConf verbosity ghcjsProgram
getDbProgramOutput verbosity ghcjsProgram
(withPrograms lbi) ["--print-libdir"]
getLibDir' :: Verbosity -> ConfiguredProgram -> IO FilePath
......
......@@ -90,7 +90,7 @@ getInstalledPackages verbosity _packageDBs conf = 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 <- rawSystemProgramStdoutConf verbosity jhcProgram conf ["--list-libraries"]
str <- getDbProgramOutput verbosity jhcProgram conf ["--list-libraries"]
let pCheck :: [(a, String)] -> [a]
pCheck rs = [ r | (r,s) <- rs, all isSpace s ]
let parseLine ln =
......
......@@ -226,7 +226,7 @@ getInstalledPackages' :: ConfiguredProgram -> Verbosity
getInstalledPackages' lhcPkg verbosity packagedbs conf
=
sequenceA
[ do str <- rawSystemProgramStdoutConf verbosity lhcPkgProgram conf
[ do str <- getDbProgramOutput verbosity lhcPkgProgram conf
["dump", packageDbGhcPkgFlag packagedb]
`catchExit` \_ -> die $ "ghc-pkg dump failed"
case parsePackages str of
......
......@@ -110,7 +110,7 @@ getInstalledPackages verbosity comp packagedbs conf = do
getGlobalPackageDir :: Verbosity -> ProgramConfiguration -> IO FilePath
getGlobalPackageDir verbosity conf = do
output <- rawSystemProgramStdoutConf verbosity
output <- getDbProgramOutput verbosity
uhcProgram conf ["--meta-pkgdir-system"]
-- call to "lines" necessary, because pkgdir contains an extra newline at the end
let [pkgdir] = lines output
......
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