diff options
author | Joey Hess <joey@kitenet.net> | 2013-09-25 23:19:01 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-09-25 23:19:01 -0400 |
commit | f32cb2cf1576db1395f77bd5f7f0c0a3e86c1334 (patch) | |
tree | 7d61d584b86f263659c96d21e5aac235f6abe239 /Remote/Helper | |
parent | 9559613df8bb914b5034ba0f1aafd26884e5d9e7 (diff) |
hlint
Diffstat (limited to 'Remote/Helper')
-rw-r--r-- | Remote/Helper/Chunked.hs | 8 | ||||
-rw-r--r-- | Remote/Helper/Hooks.hs | 6 | ||||
-rw-r--r-- | Remote/Helper/Ssh.hs | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs index 46678de70..c4cec37ea 100644 --- a/Remote/Helper/Chunked.hs +++ b/Remote/Helper/Chunked.hs @@ -68,7 +68,7 @@ storeChunks key tmp dest chunksize storer recorder finalizer = either onerr retu where go = do stored <- storer tmpdests - when (chunksize /= Nothing) $ do + when (isNothing chunksize) $ do let chunkcount = basef ++ chunkCount recorder chunkcount (show $ length stored) finalizer tmp dest @@ -79,7 +79,7 @@ storeChunks key tmp dest chunksize storer recorder finalizer = either onerr retu basef = tmp ++ keyFile key tmpdests - | chunksize == Nothing = [basef] + | isNothing chunksize = [basef] | otherwise = map (basef ++ ) chunkStream {- Given a list of destinations to use, chunks the data according to the @@ -123,5 +123,5 @@ storeChunked chunksize dests storer content = either onerr return meteredWriteFileChunks :: MeterUpdate -> FilePath -> [v] -> (v -> IO L.ByteString) -> IO () meteredWriteFileChunks meterupdate dest chunks feeder = withBinaryFile dest WriteMode $ \h -> - forM_ chunks $ \c -> - meteredWrite meterupdate h =<< feeder c + forM_ chunks $ + meteredWrite meterupdate h <=< feeder diff --git a/Remote/Helper/Hooks.hs b/Remote/Helper/Hooks.hs index 7c2bf68ca..665da1e10 100644 --- a/Remote/Helper/Hooks.hs +++ b/Remote/Helper/Hooks.hs @@ -35,8 +35,8 @@ addHooks' r starthook stophook = r' { storeKey = \k f p -> wrapper $ storeKey r k f p , retrieveKeyFile = \k f d p -> wrapper $ retrieveKeyFile r k f d p , retrieveKeyFileCheap = \k f -> wrapper $ retrieveKeyFileCheap r k f - , removeKey = \k -> wrapper $ removeKey r k - , hasKey = \k -> wrapper $ hasKey r k + , removeKey = wrapper . removeKey r + , hasKey = wrapper . hasKey r } where wrapper = runHooks r' starthook stophook @@ -45,7 +45,7 @@ runHooks :: Remote -> Maybe String -> Maybe String -> Annex a -> Annex a runHooks r starthook stophook a = do dir <- fromRepo gitAnnexRemotesDir let lck = dir </> remoteid ++ ".lck" - whenM (not . any (== lck) . M.keys <$> getPool) $ do + whenM (notElem lck . M.keys <$> getPool) $ do liftIO $ createDirectoryIfMissing True dir firstrun lck a diff --git a/Remote/Helper/Ssh.hs b/Remote/Helper/Ssh.hs index c71572434..82c7c3896 100644 --- a/Remote/Helper/Ssh.hs +++ b/Remote/Helper/Ssh.hs @@ -125,9 +125,9 @@ rsyncParamsRemote r direction key file afile = do -- Convert the ssh command into rsync command line. let eparam = rsyncShell (Param shellcmd:shellparams) let o = rsyncParams r - if direction == Download - then return $ o ++ rsyncopts eparam dummy (File file) - else return $ o ++ rsyncopts eparam (File file) dummy + return $ if direction == Download + then o ++ rsyncopts eparam dummy (File file) + else o ++ rsyncopts eparam (File file) dummy where rsyncopts ps source dest | end ps == [dashdash] = ps ++ [source, dest] @@ -143,6 +143,6 @@ rsyncParamsRemote r direction key file afile = do -- --inplace to resume partial files rsyncParams :: Remote -> [CommandParam] -rsyncParams r = [Params "--progress --inplace"] ++ +rsyncParams r = Params "--progress --inplace" : map Param (remoteAnnexRsyncOptions $ gitconfig r) |