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.

This commit is contained in:
Joey Hess 2013-06-10 13:10:30 -04:00
parent 9cf6d8130c
commit a64106dcef
6 changed files with 65 additions and 45 deletions

View file

@ -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 ++