rsync special remote: Include annex-rsync-options when running rsync to test a key's presence.

Also, use the new withQuietOutput function to avoid running the shell to
/dev/null stderr in two other places.
This commit is contained in:
Joey Hess 2012-10-28 13:51:14 -04:00
parent 67454ab7f3
commit 9767562f65
6 changed files with 39 additions and 18 deletions

View file

@ -23,6 +23,7 @@ module Utility.Process (
createBackgroundProcess,
withHandle,
withBothHandles,
withQuietOutput,
createProcess,
runInteractiveProcess,
stdinHandle,
@ -185,6 +186,19 @@ withBothHandles creator p a = creator p' $ a . bothHandles
, std_err = Inherit
}
{- Forces the CreateProcessRunner to run quietly;
- both stdout and stderr are discarded. -}
withQuietOutput
:: CreateProcessRunner
-> CreateProcess
-> IO ()
withQuietOutput creator p = withFile "/dev/null" WriteMode $ \devnull -> do
let p' = p
{ std_out = UseHandle devnull
, std_err = UseHandle devnull
}
creator p' $ const $ return ()
{- Extract a desired handle from createProcess's tuple.
- These partial functions are safe as long as createProcess is run
- with appropriate parameters to set up the desired handle.