explicity use sh -c when running shell commands
This is necessary to work in Windows. (And will only work when building in Cygwin.)
This commit is contained in:
parent
a05b4619bb
commit
258af9c6da
1 changed files with 5 additions and 4 deletions
9
Build/TestConfig.hs
Normal file → Executable file
9
Build/TestConfig.hs
Normal file → Executable file
|
@ -4,6 +4,7 @@ module Build.TestConfig where
|
||||||
|
|
||||||
import Utility.Path
|
import Utility.Path
|
||||||
import Utility.Monad
|
import Utility.Monad
|
||||||
|
import Utility.SafeCommand
|
||||||
|
|
||||||
import System.IO
|
import System.IO
|
||||||
import System.Cmd
|
import System.Cmd
|
||||||
|
@ -75,8 +76,8 @@ requireCmd k cmdline = do
|
||||||
{- Checks if a command is available by running a command line. -}
|
{- Checks if a command is available by running a command line. -}
|
||||||
testCmd :: ConfigKey -> String -> Test
|
testCmd :: ConfigKey -> String -> Test
|
||||||
testCmd k cmdline = do
|
testCmd k cmdline = do
|
||||||
ret <- system $ quiet cmdline
|
ok <- boolSystem "sh" [ Param "-c", Param $ quiet cmdline ]
|
||||||
return $ Config k (BoolConfig $ ret == ExitSuccess)
|
return $ Config k (BoolConfig ok)
|
||||||
|
|
||||||
{- Ensures that one of a set of commands is available by running each in
|
{- Ensures that one of a set of commands is available by running each in
|
||||||
- turn. The Config is set to the first one found. -}
|
- turn. The Config is set to the first one found. -}
|
||||||
|
@ -98,8 +99,8 @@ searchCmd success failure cmdsparams = search cmdsparams
|
||||||
where
|
where
|
||||||
search [] = failure $ fst $ unzip cmdsparams
|
search [] = failure $ fst $ unzip cmdsparams
|
||||||
search ((c, params):cs) = do
|
search ((c, params):cs) = do
|
||||||
ret <- system $ quiet $ c ++ " " ++ params
|
ok <- boolSystem "sh" [ Param "-c", Param $ quiet $ c ++ " " ++ params ]
|
||||||
if ret == ExitSuccess
|
if ok
|
||||||
then success c
|
then success c
|
||||||
else search cs
|
else search cs
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue