summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-10-28 13:51:14 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-10-28 13:51:14 -0400
commitef8c4afd050cc729819b97a1f8864f613b6debbd (patch)
treef1e2aa10bdc7efe682913af317fcf3bd1c05fec6 /Remote
parent9600c62cef11809a32a86cc48824a647f87fcc44 (diff)
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.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Git.hs10
-rw-r--r--Remote/Rsync.hs9
2 files changed, 12 insertions, 7 deletions
diff --git a/Remote/Git.hs b/Remote/Git.hs
index 860a53e18..334c8144a 100644
--- a/Remote/Git.hs
+++ b/Remote/Git.hs
@@ -429,10 +429,12 @@ commitOnCleanup r a = go `after` a
| otherwise = void $ do
Just (shellcmd, shellparams) <-
git_annex_shell r "commit" [] []
+
-- Throw away stderr, since the remote may not
-- have a new enough git-annex shell to
-- support committing.
- let cmd = shellcmd ++ " "
- ++ unwords (map shellEscape $ toCommand shellparams)
- ++ ">/dev/null 2>/dev/null"
- liftIO $ boolSystem "sh" [Param "-c", Param cmd]
+ liftIO $ catchMaybeIO $ do
+ print "!!!!!!!!!!!!!"
+ withQuietOutput createProcessSuccess $
+ proc shellcmd $
+ toCommand shellparams
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index c3ef94a71..d89699270 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -166,9 +166,12 @@ checkPresent r o k = do
-- to connect, and the file not being present.
Right <$> check
where
- check = untilTrue (rsyncUrls o k) $ \u ->
- liftIO $ boolSystem "sh" [Param "-c", Param (cmd u)]
- cmd u = "rsync --quiet " ++ shellEscape u ++ " 2>/dev/null"
+ check = untilTrue (rsyncUrls o k) $ \u ->
+ liftIO $ catchBoolIO $ do
+ withQuietOutput createProcessSuccess $
+ proc "rsync" $ toCommand $
+ rsyncOptions o ++ [Param u]
+ return True
{- Rsync params to enable resumes of sending files safely,
- ensure that files are only moved into place once complete