summaryrefslogtreecommitdiff
path: root/Build/TestConfig.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <id@joeyh.name>2013-05-10 15:21:32 -0500
committerGravatar Joey Hess <id@joeyh.name>2013-05-10 15:21:32 -0500
commitee9520e91bf2209446354c3fb93673ea1091d39c (patch)
treeb354011757dd9ddf074a24fbad77249f4d380aab /Build/TestConfig.hs
parent493db9a024a89f1f696a858789ce55844a180215 (diff)
explicity use sh -c when running shell commands
This is necessary to work in Windows. (And will only work when building in Cygwin.)
Diffstat (limited to 'Build/TestConfig.hs')
-rwxr-xr-x[-rw-r--r--]Build/TestConfig.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/Build/TestConfig.hs b/Build/TestConfig.hs
index 9937f799f..8628ebe58 100644..100755
--- a/Build/TestConfig.hs
+++ b/Build/TestConfig.hs
@@ -4,6 +4,7 @@ module Build.TestConfig where
import Utility.Path
import Utility.Monad
+import Utility.SafeCommand
import System.IO
import System.Cmd
@@ -75,8 +76,8 @@ requireCmd k cmdline = do
{- Checks if a command is available by running a command line. -}
testCmd :: ConfigKey -> String -> Test
testCmd k cmdline = do
- ret <- system $ quiet cmdline
- return $ Config k (BoolConfig $ ret == ExitSuccess)
+ ok <- boolSystem "sh" [ Param "-c", Param $ quiet cmdline ]
+ return $ Config k (BoolConfig ok)
{- Ensures that one of a set of commands is available by running each in
- turn. The Config is set to the first one found. -}
@@ -98,8 +99,8 @@ searchCmd success failure cmdsparams = search cmdsparams
where
search [] = failure $ fst $ unzip cmdsparams
search ((c, params):cs) = do
- ret <- system $ quiet $ c ++ " " ++ params
- if ret == ExitSuccess
+ ok <- boolSystem "sh" [ Param "-c", Param $ quiet $ c ++ " " ++ params ]
+ if ok
then success c
else search cs