rsync special remote: Fix fallback mode for rsync remotes that use hashDirMixed. Closes: #731142
This commit is contained in:
parent
f7feb2bbec
commit
0a63ed563f
3 changed files with 15 additions and 9 deletions
|
@ -257,22 +257,25 @@ withRsyncScratchDir a = do
|
||||||
|
|
||||||
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
|
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
|
||||||
rsyncRetrieve o k dest callback =
|
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
|
-- use inplace when retrieving to support resuming
|
||||||
[ Param "--inplace"
|
[ Param "--inplace"
|
||||||
, Param u
|
, Param u
|
||||||
, File dest
|
, 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 :: RsyncOpts -> Maybe MeterUpdate -> [CommandParam] -> Annex Bool
|
||||||
rsyncRemote o callback params = do
|
rsyncRemote o callback params = do
|
||||||
showOutput -- make way for progress bar
|
showOutput -- make way for progress bar
|
||||||
ifM (liftIO $ (maybe rsync rsyncProgress callback) ps)
|
liftIO $ (maybe rsync rsyncProgress callback) ps
|
||||||
( return True
|
|
||||||
, do
|
|
||||||
showLongNote "rsync failed -- run git annex again to resume file transfer"
|
|
||||||
return False
|
|
||||||
)
|
|
||||||
where
|
where
|
||||||
defaultParams = [Params "--progress"]
|
defaultParams = [Params "--progress"]
|
||||||
ps = rsyncOptions o ++ defaultParams ++ params
|
ps = rsyncOptions o ++ defaultParams ++ params
|
||||||
|
@ -298,7 +301,7 @@ rsyncSend o callback k canrename src = withRsyncScratchDir $ \tmp -> do
|
||||||
else createLinkOrCopy src dest
|
else createLinkOrCopy src dest
|
||||||
ps <- sendParams
|
ps <- sendParams
|
||||||
if ok
|
if ok
|
||||||
then rsyncRemote o (Just callback) $ ps ++
|
then showResumable $ rsyncRemote o (Just callback) $ ps ++
|
||||||
[ Param "--recursive"
|
[ Param "--recursive"
|
||||||
, partialParams
|
, partialParams
|
||||||
-- tmp/ to send contents of tmp dir
|
-- tmp/ to send contents of tmp dir
|
||||||
|
|
|
@ -67,7 +67,8 @@ rsyncParamsFixup = map fixup
|
||||||
-}
|
-}
|
||||||
rsyncProgress :: MeterUpdate -> [CommandParam] -> IO Bool
|
rsyncProgress :: MeterUpdate -> [CommandParam] -> IO Bool
|
||||||
rsyncProgress meterupdate params = do
|
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
|
{- For an unknown reason, piping rsync's output like this does
|
||||||
- causes it to run a second ssh process, which it neglects to wait
|
- causes it to run a second ssh process, which it neglects to wait
|
||||||
- on. Reap the resulting zombie. -}
|
- on. Reap the resulting zombie. -}
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -7,6 +7,8 @@ git-annex (5.20131131) UNRELEASED; urgency=low
|
||||||
* assistant: Run transferkeys as batch jobs.
|
* assistant: Run transferkeys as batch jobs.
|
||||||
* Automatically fix up bad bare repositories created by
|
* Automatically fix up bad bare repositories created by
|
||||||
versions 5.20131118 through 5.20131127.
|
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
|
-- Joey Hess <joeyh@debian.org> Sun, 01 Dec 2013 13:57:58 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue