diff options
Diffstat (limited to 'Utility/Rsync.hs')
-rw-r--r-- | Utility/Rsync.hs | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/Utility/Rsync.hs b/Utility/Rsync.hs index af76647fd..1b022c184 100644 --- a/Utility/Rsync.hs +++ b/Utility/Rsync.hs @@ -57,15 +57,16 @@ rsyncProgress callback params = catchBoolIO $ withHandle StdoutHandle createProcessSuccess p (feedprogress []) where p = proc "rsync" (toCommand params) - feedprogress buf h = - catchMaybeIO (hGetChar h) >>= \v -> case v of - Just c -> do - putChar c + feedprogress buf h = do + s <- hGetSomeString h 80 + if null s + then return True + else do + putStr s hFlush stdout - let (mbytes, buf') = parseRsyncProgress (buf++[c]) + let (mbytes, buf') = parseRsyncProgress (buf++s) maybe noop callback mbytes feedprogress buf' h - Nothing -> return True {- Checks if an rsync url involves the remote shell (ssh or rsh). - Use of such urls with rsync requires additional shell |