summaryrefslogtreecommitdiff
path: root/Remote/Rsync.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-06-10 13:10:30 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-06-10 13:11:33 -0400
commita5cb4a7bc5d7d603fc8f5f8b1a1595e889fb25ce (patch)
tree9b1e97311129413c5e0d33e9b52caa0ab66809dc /Remote/Rsync.hs
parent7bf5b7b0c5ba2789ef1473329da0000af0410b61 (diff)
Supports indirect mode on encfs in paranoia mode, and other filesystems that do not support hard links, but do support symlinks and other POSIX filesystem features.
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r--Remote/Rsync.hs17
1 files changed, 4 insertions, 13 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index f7abbbf2a..228a66d51 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -264,7 +264,7 @@ rsyncRemote o callback params = do
-
- This would not be necessary if the hash directory structure used locally
- was always the same as that used on the rsync remote. So if that's ever
- - unified, this gets nicer. Especially in the crippled filesystem case.
+ - unified, this gets nicer.
- (When we have the right hash directory structure, we can just
- pass --include=X --include=X/Y --include=X/Y/file --exclude=*)
-}
@@ -272,20 +272,11 @@ rsyncSend :: RsyncOpts -> MeterUpdate -> Key -> Bool -> FilePath -> Annex Bool
rsyncSend o callback k canrename src = withRsyncScratchDir $ \tmp -> do
let dest = tmp </> Prelude.head (keyPaths k)
liftIO $ createDirectoryIfMissing True $ parentDir dest
- ok <- if canrename
+ ok <- liftIO $ if canrename
then do
- liftIO $ renameFile src dest
+ renameFile src dest
return True
- else ifM crippledFileSystem
- ( liftIO $ copyFileExternal src dest
- , do
-#ifndef __WINDOWS__
- liftIO $ createLink src dest
- return True
-#else
- liftIO $ copyFileExternal src dest
-#endif
- )
+ else createLinkOrCopy src dest
ps <- sendParams
if ok
then rsyncRemote o (Just callback) $ ps ++