diff options
author | Joey Hess <joey@kitenet.net> | 2011-07-15 12:47:14 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-07-15 12:47:14 -0400 |
commit | 6c396a256c93464d726c66a95132536941871ee8 (patch) | |
tree | 7f934c9eae22a9cfd3fb1672ebd7bf6870439c81 /Remote/Rsync.hs | |
parent | 185f0b687081f47d059cc0503f4f6b671868f753 (diff) |
finished hlint pass
Diffstat (limited to 'Remote/Rsync.hs')
-rw-r--r-- | Remote/Rsync.hs | 12 |
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 |