summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-02 12:53:39 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-02 12:53:39 -0400
commit9293b49b13847df885953aac690f661d88d34dff (patch)
treeed9865353aa316890093745269601d606269cfcc
parent1a78145e72eeb5abf58e3fee63088ca755a61e50 (diff)
rsync special remote: Fix fallback mode for rsync remotes that use hashDirMixed. Closes: #731142
-rw-r--r--Remote/Rsync.hs19
-rw-r--r--Utility/Rsync.hs3
-rw-r--r--debian/changelog2
3 files changed, 15 insertions, 9 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 91638de98..627690d2b 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -257,22 +257,25 @@ withRsyncScratchDir a = do
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
rsyncRetrieve o k dest callback =
- untilTrue (rsyncUrls o k) $ \u -> rsyncRemote o callback
+ showResumable $ untilTrue (rsyncUrls o k) $ \u -> rsyncRemote o callback
-- use inplace when retrieving to support resuming
[ Param "--inplace"
, Param u
, File dest
]
+showResumable :: Annex Bool -> Annex Bool
+showResumable a = ifM a
+ ( return True
+ , do
+ showLongNote "rsync failed -- run git annex again to resume file transfer"
+ return False
+ )
+
rsyncRemote :: RsyncOpts -> Maybe MeterUpdate -> [CommandParam] -> Annex Bool
rsyncRemote o callback params = do
showOutput -- make way for progress bar
- ifM (liftIO $ (maybe rsync rsyncProgress callback) ps)
- ( return True
- , do
- showLongNote "rsync failed -- run git annex again to resume file transfer"
- return False
- )
+ liftIO $ (maybe rsync rsyncProgress callback) ps
where
defaultParams = [Params "--progress"]
ps = rsyncOptions o ++ defaultParams ++ params
@@ -298,7 +301,7 @@ rsyncSend o callback k canrename src = withRsyncScratchDir $ \tmp -> do
else createLinkOrCopy src dest
ps <- sendParams
if ok
- then rsyncRemote o (Just callback) $ ps ++
+ then showResumable $ rsyncRemote o (Just callback) $ ps ++
[ Param "--recursive"
, partialParams
-- tmp/ to send contents of tmp dir
diff --git a/Utility/Rsync.hs b/Utility/Rsync.hs
index 5f322a0cb..2c5e39b6e 100644
--- a/Utility/Rsync.hs
+++ b/Utility/Rsync.hs
@@ -67,7 +67,8 @@ rsyncParamsFixup = map fixup
-}
rsyncProgress :: MeterUpdate -> [CommandParam] -> IO Bool
rsyncProgress meterupdate params = do
- r <- withHandle StdoutHandle createProcessSuccess p (feedprogress 0 [])
+ r <- catchBoolIO $
+ withHandle StdoutHandle createProcessSuccess p (feedprogress 0 [])
{- For an unknown reason, piping rsync's output like this does
- causes it to run a second ssh process, which it neglects to wait
- on. Reap the resulting zombie. -}
diff --git a/debian/changelog b/debian/changelog
index a89bd4e7f..8aa16d6a5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -7,6 +7,8 @@ git-annex (5.20131131) UNRELEASED; urgency=low
* assistant: Run transferkeys as batch jobs.
* Automatically fix up bad bare repositories created by
versions 5.20131118 through 5.20131127.
+ * rsync special remote: Fix fallback mode for rsync remotes that
+ use hashDirMixed. Closes: #731142
-- Joey Hess <joeyh@debian.org> Sun, 01 Dec 2013 13:57:58 -0400