Fix rsync special remote to work when -Jn is used for concurrent uploads.
This commit is contained in:
parent
231820dead
commit
506452012c
4 changed files with 19 additions and 9 deletions
|
@ -39,6 +39,7 @@ import Logs.Transfer
|
|||
import Types.Creds
|
||||
import Types.Key (isChunkKey)
|
||||
import Annex.DirHashes
|
||||
import Utility.Tmp
|
||||
|
||||
import qualified Data.Map as M
|
||||
|
||||
|
@ -252,16 +253,8 @@ sendParams = ifM crippledFileSystem
|
|||
- up trees for rsync. -}
|
||||
withRsyncScratchDir :: (FilePath -> Annex a) -> Annex a
|
||||
withRsyncScratchDir a = do
|
||||
p <- liftIO getPID
|
||||
t <- fromRepo gitAnnexTmpObjectDir
|
||||
createAnnexDirectory t
|
||||
let tmp = t </> "rsynctmp" </> show p
|
||||
nuke tmp
|
||||
liftIO $ createDirectoryIfMissing True tmp
|
||||
nuke tmp `after` a tmp
|
||||
where
|
||||
nuke d = liftIO $ whenM (doesDirectoryExist d) $
|
||||
removeDirectoryRecursive d
|
||||
withTmpDirIn t "rsynctmp" a
|
||||
|
||||
rsyncRetrieve :: RsyncOpts -> Key -> FilePath -> Maybe MeterUpdate -> Annex Bool
|
||||
rsyncRetrieve o k dest meterupdate =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue