summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-04-28 16:08:18 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-04-28 16:08:18 -0400
commitb5072b7b4cab21118f60c55a58497f363f749244 (patch)
tree43c44f409b378754f6ae47416e89a352722d8e3d
parent56eaf4470aee904f3dd6fe245fc59d35618d2b2e (diff)
add boolSystemEnv
-rw-r--r--Utility.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Utility.hs b/Utility.hs
index 51bbc17a3..0dab37104 100644
--- a/Utility.hs
+++ b/Utility.hs
@@ -16,6 +16,7 @@ module Utility (
relPathCwdToFile,
relPathDirToFile,
boolSystem,
+ boolSystemEnv,
shellEscape,
shellUnEscape,
unsetFileMode,
@@ -73,7 +74,10 @@ toCommand l = concat $ map unwrap l
- SIGINT(ctrl-c) is allowed to propigate and will terminate the program.
-}
boolSystem :: FilePath -> [CommandParam] -> IO Bool
-boolSystem command params = do
+boolSystem command params = boolSystemEnv command params Nothing
+
+boolSystemEnv :: FilePath -> [CommandParam] -> Maybe [(String, String)] -> IO Bool
+boolSystemEnv command params env = do
-- Going low-level because all the high-level system functions
-- block SIGINT etc. We need to block SIGCHLD, but allow
-- SIGINT to do its default program termination.
@@ -93,7 +97,7 @@ boolSystem command params = do
setSignalMask oldset
childaction oldint oldset = do
restoresignals oldint oldset
- executeFile command True (toCommand params) Nothing
+ executeFile command True (toCommand params) env
{- Escapes a filename or other parameter to be safely able to be exposed to
- the shell. -}