finished hlint pass
This commit is contained in:
parent
185f0b6870
commit
6c396a256c
29 changed files with 114 additions and 115 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue