merge from propellor
This commit is contained in:
parent
ef5496b8de
commit
8b09e9306a
2 changed files with 11 additions and 8 deletions
|
@ -41,9 +41,12 @@ module Utility.Process (
|
|||
devNull,
|
||||
) where
|
||||
|
||||
import qualified System.Process
|
||||
import qualified System.Process as X hiding (CreateProcess(..), createProcess, runInteractiveProcess, readProcess, readProcessWithExitCode, system, rawSystem, runInteractiveCommand, runProcess)
|
||||
import System.Process hiding (createProcess, readProcess, waitForProcess)
|
||||
import qualified Utility.Process.Shim
|
||||
import qualified Utility.Process.Shim as X hiding (CreateProcess(..), createProcess, runInteractiveProcess, readProcess, readProcessWithExitCode, system, rawSystem, runInteractiveCommand, runProcess)
|
||||
import Utility.Process.Shim hiding (createProcess, readProcess, waitForProcess)
|
||||
import Utility.Misc
|
||||
import Utility.Exception
|
||||
|
||||
import System.Exit
|
||||
import System.IO
|
||||
import System.Log.Logger
|
||||
|
@ -58,9 +61,6 @@ import Control.Applicative
|
|||
import Data.Maybe
|
||||
import Prelude
|
||||
|
||||
import Utility.Misc
|
||||
import Utility.Exception
|
||||
|
||||
type CreateProcessRunner = forall a. CreateProcess -> ((Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO a) -> IO a
|
||||
|
||||
data StdHandle = StdinHandle | StdoutHandle | StderrHandle
|
||||
|
@ -372,7 +372,7 @@ startInteractiveProcess cmd args environ = do
|
|||
createProcess :: CreateProcess -> IO (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle)
|
||||
createProcess p = do
|
||||
debugProcess p
|
||||
System.Process.createProcess p
|
||||
Utility.Process.Shim.createProcess p
|
||||
|
||||
-- | Debugging trace for a CreateProcess.
|
||||
debugProcess :: CreateProcess -> IO ()
|
||||
|
@ -392,6 +392,6 @@ debugProcess p = debugM "Utility.Process" $ unwords
|
|||
-- | Wrapper around 'System.Process.waitForProcess' that does debug logging.
|
||||
waitForProcess :: ProcessHandle -> IO ExitCode
|
||||
waitForProcess h = do
|
||||
r <- System.Process.waitForProcess h
|
||||
r <- Utility.Process.Shim.waitForProcess h
|
||||
debugM "Utility.Process" ("process done " ++ show r)
|
||||
return r
|
||||
|
|
3
Utility/Process/Shim.hs
Normal file
3
Utility/Process/Shim.hs
Normal file
|
@ -0,0 +1,3 @@
|
|||
module Utility.Process.Shim (module X) where
|
||||
|
||||
import System.Process as X
|
Loading…
Add table
Reference in a new issue