summaryrefslogtreecommitdiff
path: root/Remote/Rsync.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r--Remote/Rsync.hs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Remote/Rsync.hs b/Remote/Rsync.hs
index 80e194fed..ca4236276 100644
--- a/Remote/Rsync.hs
+++ b/Remote/Rsync.hs
@@ -15,6 +15,7 @@ import System.FilePath
import System.Directory
import System.Posix.Files
import System.Posix.Process
+import Data.Maybe
import Types
import Types.Remote
@@ -82,7 +83,7 @@ genRsyncOpts r = do
rsyncSetup :: UUID -> RemoteConfig -> Annex RemoteConfig
rsyncSetup u c = do
-- verify configuration is sane
- let url = maybe (error "Specify rsyncurl=") id $
+ let url = fromMaybe (error "Specify rsyncurl=") $
M.lookup "rsyncurl" c
c' <- encryptionSetup c
@@ -160,10 +161,10 @@ partialParams = Params "--no-inplace --partial --partial-dir=.rsync-partial"
withRsyncScratchDir :: (FilePath -> Annex Bool) -> Annex Bool
withRsyncScratchDir a = do
g <- Annex.gitRepo
- pid <- liftIO $ getProcessID
+ pid <- liftIO getProcessID
let tmp = gitAnnexTmpDir g </> "rsynctmp" </> show pid
nuke tmp
- liftIO $ createDirectoryIfMissing True $ tmp
+ liftIO $ createDirectoryIfMissing True tmp
res <- a tmp
nuke tmp
return res
@@ -189,15 +190,14 @@ rsyncRemote o params = do
rsyncSend :: RsyncOpts -> Key -> FilePath -> Annex Bool
rsyncSend o k src = withRsyncScratchDir $ \tmp -> do
let dest = tmp </> hashDirMixed k </> f </> f
- liftIO $ createDirectoryIfMissing True $ parentDir $ dest
+ liftIO $ createDirectoryIfMissing True $ parentDir dest
liftIO $ createLink src dest
- res <- rsyncRemote o
+ rsyncRemote o
[ Param "--recursive"
, partialParams
-- tmp/ to send contents of tmp dir
, Param $ addTrailingPathSeparator tmp
, Param $ rsyncUrl o
]
- return res
where
f = keyFile k