hlint
This commit is contained in:
parent
8cc90219d2
commit
c1990702e9
15 changed files with 40 additions and 42 deletions
|
@ -265,7 +265,7 @@ getFailedTransfers u = catMaybes <$> (liftIO . getpairs =<< concat <$> findfiles
|
||||||
clearFailedTransfers :: UUID -> Annex [(Transfer, TransferInfo)]
|
clearFailedTransfers :: UUID -> Annex [(Transfer, TransferInfo)]
|
||||||
clearFailedTransfers u = do
|
clearFailedTransfers u = do
|
||||||
failed <- getFailedTransfers u
|
failed <- getFailedTransfers u
|
||||||
mapM_ removeFailedTransfer $ map fst failed
|
mapM_ (removeFailedTransfer . fst) failed
|
||||||
return failed
|
return failed
|
||||||
|
|
||||||
removeFailedTransfer :: Transfer -> Annex ()
|
removeFailedTransfer :: Transfer -> Annex ()
|
||||||
|
|
|
@ -82,6 +82,5 @@ transitionList = map transition . S.elems
|
||||||
{- Typically ran with Annex.Branch.change, but we can't import Annex.Branch
|
{- Typically ran with Annex.Branch.change, but we can't import Annex.Branch
|
||||||
- here since it depends on this module. -}
|
- here since it depends on this module. -}
|
||||||
recordTransitions :: (FilePath -> (String -> String) -> Annex ()) -> Transitions -> Annex ()
|
recordTransitions :: (FilePath -> (String -> String) -> Annex ()) -> Transitions -> Annex ()
|
||||||
recordTransitions changer t = do
|
recordTransitions changer t = changer transitionsLog $
|
||||||
changer transitionsLog $
|
showTransitions . S.union t . parseTransitionsStrictly "local"
|
||||||
showTransitions . S.union t . parseTransitionsStrictly "local"
|
|
||||||
|
|
|
@ -12,7 +12,6 @@ module Remote.Directory (remote) where
|
||||||
import qualified Data.ByteString.Lazy as L
|
import qualified Data.ByteString.Lazy as L
|
||||||
import qualified Data.ByteString as S
|
import qualified Data.ByteString as S
|
||||||
import qualified Data.Map as M
|
import qualified Data.Map as M
|
||||||
import qualified Control.Exception as E
|
|
||||||
import Data.Int
|
import Data.Int
|
||||||
|
|
||||||
import Common.Annex
|
import Common.Annex
|
||||||
|
@ -109,7 +108,7 @@ withCheckedFiles check (Just _) d k a = go $ locations d k
|
||||||
ifM (check chunkcount)
|
ifM (check chunkcount)
|
||||||
( do
|
( do
|
||||||
chunks <- listChunks f <$> readFile chunkcount
|
chunks <- listChunks f <$> readFile chunkcount
|
||||||
ifM (all id <$> mapM check chunks)
|
ifM (and <$> mapM check chunks)
|
||||||
( a chunks , return False )
|
( a chunks , return False )
|
||||||
, go fs
|
, go fs
|
||||||
)
|
)
|
||||||
|
@ -159,7 +158,7 @@ storeSplit' :: MeterUpdate -> Int64 -> [FilePath] -> [S.ByteString] -> [FilePath
|
||||||
storeSplit' _ _ [] _ _ = error "ran out of dests"
|
storeSplit' _ _ [] _ _ = error "ran out of dests"
|
||||||
storeSplit' _ _ _ [] c = return $ reverse c
|
storeSplit' _ _ _ [] c = return $ reverse c
|
||||||
storeSplit' meterupdate chunksize (d:dests) bs c = do
|
storeSplit' meterupdate chunksize (d:dests) bs c = do
|
||||||
bs' <- E.bracket (openFile d WriteMode) hClose $
|
bs' <- withFile d WriteMode $
|
||||||
feed zeroBytesProcessed chunksize bs
|
feed zeroBytesProcessed chunksize bs
|
||||||
storeSplit' meterupdate chunksize dests bs' (d:c)
|
storeSplit' meterupdate chunksize dests bs' (d:c)
|
||||||
where
|
where
|
||||||
|
@ -206,7 +205,7 @@ retrieve :: FilePath -> ChunkSize -> Key -> AssociatedFile -> FilePath -> MeterU
|
||||||
retrieve d chunksize k _ f p = metered (Just p) k $ \meterupdate ->
|
retrieve d chunksize k _ f p = metered (Just p) k $ \meterupdate ->
|
||||||
liftIO $ withStoredFiles chunksize d k $ \files ->
|
liftIO $ withStoredFiles chunksize d k $ \files ->
|
||||||
catchBoolIO $ do
|
catchBoolIO $ do
|
||||||
meteredWriteFileChunks meterupdate f files $ L.readFile
|
meteredWriteFileChunks meterupdate f files L.readFile
|
||||||
return True
|
return True
|
||||||
|
|
||||||
retrieveEncrypted :: FilePath -> ChunkSize -> (Cipher, Key) -> Key -> FilePath -> MeterUpdate -> Annex Bool
|
retrieveEncrypted :: FilePath -> ChunkSize -> (Cipher, Key) -> Key -> FilePath -> MeterUpdate -> Annex Bool
|
||||||
|
@ -217,7 +216,7 @@ retrieveEncrypted d chunksize (cipher, enck) k f p = metered (Just p) k $ \meter
|
||||||
readBytes $ meteredWriteFile meterupdate f
|
readBytes $ meteredWriteFile meterupdate f
|
||||||
return True
|
return True
|
||||||
where
|
where
|
||||||
feeder files h = forM_ files $ \file -> L.hPut h =<< L.readFile file
|
feeder files h = forM_ files $ L.hPut h <=< L.readFile
|
||||||
|
|
||||||
retrieveCheap :: FilePath -> ChunkSize -> Key -> FilePath -> Annex Bool
|
retrieveCheap :: FilePath -> ChunkSize -> Key -> FilePath -> Annex Bool
|
||||||
retrieveCheap _ (Just _) _ _ = return False -- no cheap retrieval for chunks
|
retrieveCheap _ (Just _) _ _ = return False -- no cheap retrieval for chunks
|
||||||
|
|
|
@ -76,7 +76,7 @@ gen gcryptr u c gc = do
|
||||||
-- correctly.
|
-- correctly.
|
||||||
resetup gcryptid r = do
|
resetup gcryptid r = do
|
||||||
let u' = genUUIDInNameSpace gCryptNameSpace gcryptid
|
let u' = genUUIDInNameSpace gCryptNameSpace gcryptid
|
||||||
v <- (M.lookup u' <$> readRemoteLog)
|
v <- M.lookup u' <$> readRemoteLog
|
||||||
case (Git.remoteName gcryptr, v) of
|
case (Git.remoteName gcryptr, v) of
|
||||||
(Just remotename, Just c') -> do
|
(Just remotename, Just c') -> do
|
||||||
setGcryptEncryption c' remotename
|
setGcryptEncryption c' remotename
|
||||||
|
@ -186,14 +186,14 @@ gCryptSetup mu c = go $ M.lookup "gitrepo" c
|
||||||
void $ inRepo $ Git.Command.runBool
|
void $ inRepo $ Git.Command.runBool
|
||||||
[ Param "push"
|
[ Param "push"
|
||||||
, Param remotename
|
, Param remotename
|
||||||
, Param $ show $ Annex.Branch.fullname
|
, Param $ show Annex.Branch.fullname
|
||||||
]
|
]
|
||||||
g <- inRepo Git.Config.reRead
|
g <- inRepo Git.Config.reRead
|
||||||
case Git.GCrypt.remoteRepoId g (Just remotename) of
|
case Git.GCrypt.remoteRepoId g (Just remotename) of
|
||||||
Nothing -> error "unable to determine gcrypt-id of remote"
|
Nothing -> error "unable to determine gcrypt-id of remote"
|
||||||
Just gcryptid -> do
|
Just gcryptid -> do
|
||||||
let u = genUUIDInNameSpace gCryptNameSpace gcryptid
|
let u = genUUIDInNameSpace gCryptNameSpace gcryptid
|
||||||
if Just u == mu || mu == Nothing
|
if Just u == mu || isNothing mu
|
||||||
then do
|
then do
|
||||||
method <- setupRepo gcryptid =<< inRepo (Git.Construct.fromRemoteLocation gitrepo)
|
method <- setupRepo gcryptid =<< inRepo (Git.Construct.fromRemoteLocation gitrepo)
|
||||||
gitConfigSpecialRemote u c' "gcrypt" (fromAccessMethod method)
|
gitConfigSpecialRemote u c' "gcrypt" (fromAccessMethod method)
|
||||||
|
@ -246,7 +246,7 @@ setupRepo gcryptid r
|
||||||
ok <- liftIO $ rsync $ rsynctransport ++
|
ok <- liftIO $ rsync $ rsynctransport ++
|
||||||
[ Params "--recursive"
|
[ Params "--recursive"
|
||||||
, Param $ tmp ++ "/"
|
, Param $ tmp ++ "/"
|
||||||
, Param $ rsyncurl
|
, Param rsyncurl
|
||||||
]
|
]
|
||||||
unless ok $
|
unless ok $
|
||||||
error "Failed to connect to remote to set it up."
|
error "Failed to connect to remote to set it up."
|
||||||
|
|
|
@ -209,7 +209,7 @@ tryGitConfigRead r
|
||||||
Nothing -> return r
|
Nothing -> return r
|
||||||
Just n -> do
|
Just n -> do
|
||||||
whenM (inRepo $ Git.Command.runBool [Param "fetch", Param "--quiet", Param n]) $
|
whenM (inRepo $ Git.Command.runBool [Param "fetch", Param "--quiet", Param n]) $
|
||||||
set_ignore $ "does not have git-annex installed"
|
set_ignore "does not have git-annex installed"
|
||||||
return r
|
return r
|
||||||
|
|
||||||
set_ignore msg = case Git.remoteName r of
|
set_ignore msg = case Git.remoteName r of
|
||||||
|
@ -326,7 +326,7 @@ copyFromRemote' r key file dest
|
||||||
: maybe [] (\f -> [(Fields.associatedFile, f)]) file
|
: maybe [] (\f -> [(Fields.associatedFile, f)]) file
|
||||||
Just (cmd, params) <- Ssh.git_annex_shell (repo r) "transferinfo"
|
Just (cmd, params) <- Ssh.git_annex_shell (repo r) "transferinfo"
|
||||||
[Param $ key2file key] fields
|
[Param $ key2file key] fields
|
||||||
v <- liftIO $ (newEmptySV :: IO (MSampleVar Integer))
|
v <- liftIO (newEmptySV :: IO (MSampleVar Integer))
|
||||||
tid <- liftIO $ forkIO $ void $ tryIO $ do
|
tid <- liftIO $ forkIO $ void $ tryIO $ do
|
||||||
bytes <- readSV v
|
bytes <- readSV v
|
||||||
p <- createProcess $
|
p <- createProcess $
|
||||||
|
@ -337,7 +337,7 @@ copyFromRemote' r key file dest
|
||||||
hClose $ stderrHandle p
|
hClose $ stderrHandle p
|
||||||
let h = stdinHandle p
|
let h = stdinHandle p
|
||||||
let send b = do
|
let send b = do
|
||||||
hPutStrLn h $ show b
|
hPrint h b
|
||||||
hFlush h
|
hFlush h
|
||||||
send bytes
|
send bytes
|
||||||
forever $
|
forever $
|
||||||
|
@ -414,7 +414,7 @@ rsyncOrCopyFile rsyncparams src dest p =
|
||||||
#else
|
#else
|
||||||
ifM (sameDeviceIds src dest) (docopy, dorsync)
|
ifM (sameDeviceIds src dest) (docopy, dorsync)
|
||||||
where
|
where
|
||||||
sameDeviceIds a b = (==) <$> (getDeviceId a) <*> (getDeviceId b)
|
sameDeviceIds a b = (==) <$> getDeviceId a <*> getDeviceId b
|
||||||
getDeviceId f = deviceID <$> liftIO (getFileStatus $ parentDir f)
|
getDeviceId f = deviceID <$> liftIO (getFileStatus $ parentDir f)
|
||||||
docopy = liftIO $ bracket
|
docopy = liftIO $ bracket
|
||||||
(forkIO $ watchfilesize zeroBytesProcessed)
|
(forkIO $ watchfilesize zeroBytesProcessed)
|
||||||
|
@ -450,7 +450,7 @@ commitOnCleanup r a = go `after` a
|
||||||
-- Throw away stderr, since the remote may not
|
-- Throw away stderr, since the remote may not
|
||||||
-- have a new enough git-annex shell to
|
-- have a new enough git-annex shell to
|
||||||
-- support committing.
|
-- support committing.
|
||||||
liftIO $ catchMaybeIO $ do
|
liftIO $ catchMaybeIO $
|
||||||
withQuietOutput createProcessSuccess $
|
withQuietOutput createProcessSuccess $
|
||||||
proc shellcmd $
|
proc shellcmd $
|
||||||
toCommand shellparams
|
toCommand shellparams
|
||||||
|
|
|
@ -98,7 +98,7 @@ store r k _f p
|
||||||
storeHelper r k $ streamMeteredFile src meterupdate
|
storeHelper r k $ streamMeteredFile src meterupdate
|
||||||
|
|
||||||
storeEncrypted :: Remote -> (Cipher, Key) -> Key -> MeterUpdate -> Annex Bool
|
storeEncrypted :: Remote -> (Cipher, Key) -> Key -> MeterUpdate -> Annex Bool
|
||||||
storeEncrypted r (cipher, enck) k p = sendAnnex k (void $ remove r enck) $ \src -> do
|
storeEncrypted r (cipher, enck) k p = sendAnnex k (void $ remove r enck) $ \src ->
|
||||||
metered (Just p) k $ \meterupdate ->
|
metered (Just p) k $ \meterupdate ->
|
||||||
storeHelper r enck $ \h ->
|
storeHelper r enck $ \h ->
|
||||||
encrypt (getGpgEncParams r) cipher (feedFile src)
|
encrypt (getGpgEncParams r) cipher (feedFile src)
|
||||||
|
@ -209,7 +209,7 @@ checkPresent r k = do
|
||||||
]
|
]
|
||||||
|
|
||||||
glacierAction :: Remote -> [CommandParam] -> Annex Bool
|
glacierAction :: Remote -> [CommandParam] -> Annex Bool
|
||||||
glacierAction r params = runGlacier (config r) (uuid r) params
|
glacierAction r = runGlacier (config r) (uuid r)
|
||||||
|
|
||||||
runGlacier :: RemoteConfig -> UUID -> [CommandParam] -> Annex Bool
|
runGlacier :: RemoteConfig -> UUID -> [CommandParam] -> Annex Bool
|
||||||
runGlacier c u params = go =<< glacierEnv c u
|
runGlacier c u params = go =<< glacierEnv c u
|
||||||
|
@ -222,7 +222,7 @@ glacierParams :: RemoteConfig -> [CommandParam] -> [CommandParam]
|
||||||
glacierParams c params = datacenter:params
|
glacierParams c params = datacenter:params
|
||||||
where
|
where
|
||||||
datacenter = Param $ "--region=" ++
|
datacenter = Param $ "--region=" ++
|
||||||
(fromJust $ M.lookup "datacenter" c)
|
fromJust (M.lookup "datacenter" c)
|
||||||
|
|
||||||
glacierEnv :: RemoteConfig -> UUID -> Annex (Maybe [(String, String)])
|
glacierEnv :: RemoteConfig -> UUID -> Annex (Maybe [(String, String)])
|
||||||
glacierEnv c u = go =<< getRemoteCredPairFor "glacier" c creds
|
glacierEnv c u = go =<< getRemoteCredPairFor "glacier" c creds
|
||||||
|
@ -282,7 +282,7 @@ jobList r keys = go =<< glacierEnv (config r) (uuid r)
|
||||||
enckeys <- forM keys $ \k ->
|
enckeys <- forM keys $ \k ->
|
||||||
maybe k snd <$> cipherKey (config r) k
|
maybe k snd <$> cipherKey (config r) k
|
||||||
let keymap = M.fromList $ zip enckeys keys
|
let keymap = M.fromList $ zip enckeys keys
|
||||||
let convert = catMaybes . map (`M.lookup` keymap)
|
let convert = mapMaybe (`M.lookup` keymap)
|
||||||
return (convert succeeded, convert failed)
|
return (convert succeeded, convert failed)
|
||||||
|
|
||||||
parse c [] = c
|
parse c [] = c
|
||||||
|
|
|
@ -68,7 +68,7 @@ storeChunks key tmp dest chunksize storer recorder finalizer = either onerr retu
|
||||||
where
|
where
|
||||||
go = do
|
go = do
|
||||||
stored <- storer tmpdests
|
stored <- storer tmpdests
|
||||||
when (chunksize /= Nothing) $ do
|
when (isNothing chunksize) $ do
|
||||||
let chunkcount = basef ++ chunkCount
|
let chunkcount = basef ++ chunkCount
|
||||||
recorder chunkcount (show $ length stored)
|
recorder chunkcount (show $ length stored)
|
||||||
finalizer tmp dest
|
finalizer tmp dest
|
||||||
|
@ -79,7 +79,7 @@ storeChunks key tmp dest chunksize storer recorder finalizer = either onerr retu
|
||||||
|
|
||||||
basef = tmp ++ keyFile key
|
basef = tmp ++ keyFile key
|
||||||
tmpdests
|
tmpdests
|
||||||
| chunksize == Nothing = [basef]
|
| isNothing chunksize = [basef]
|
||||||
| otherwise = map (basef ++ ) chunkStream
|
| otherwise = map (basef ++ ) chunkStream
|
||||||
|
|
||||||
{- Given a list of destinations to use, chunks the data according to the
|
{- 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 -> FilePath -> [v] -> (v -> IO L.ByteString) -> IO ()
|
||||||
meteredWriteFileChunks meterupdate dest chunks feeder =
|
meteredWriteFileChunks meterupdate dest chunks feeder =
|
||||||
withBinaryFile dest WriteMode $ \h ->
|
withBinaryFile dest WriteMode $ \h ->
|
||||||
forM_ chunks $ \c ->
|
forM_ chunks $
|
||||||
meteredWrite meterupdate h =<< feeder c
|
meteredWrite meterupdate h <=< feeder
|
||||||
|
|
|
@ -35,8 +35,8 @@ addHooks' r starthook stophook = r'
|
||||||
{ storeKey = \k f p -> wrapper $ storeKey r k f p
|
{ storeKey = \k f p -> wrapper $ storeKey r k f p
|
||||||
, retrieveKeyFile = \k f d p -> wrapper $ retrieveKeyFile r k f d p
|
, retrieveKeyFile = \k f d p -> wrapper $ retrieveKeyFile r k f d p
|
||||||
, retrieveKeyFileCheap = \k f -> wrapper $ retrieveKeyFileCheap r k f
|
, retrieveKeyFileCheap = \k f -> wrapper $ retrieveKeyFileCheap r k f
|
||||||
, removeKey = \k -> wrapper $ removeKey r k
|
, removeKey = wrapper . removeKey r
|
||||||
, hasKey = \k -> wrapper $ hasKey r k
|
, hasKey = wrapper . hasKey r
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
wrapper = runHooks r' starthook stophook
|
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
|
runHooks r starthook stophook a = do
|
||||||
dir <- fromRepo gitAnnexRemotesDir
|
dir <- fromRepo gitAnnexRemotesDir
|
||||||
let lck = dir </> remoteid ++ ".lck"
|
let lck = dir </> remoteid ++ ".lck"
|
||||||
whenM (not . any (== lck) . M.keys <$> getPool) $ do
|
whenM (notElem lck . M.keys <$> getPool) $ do
|
||||||
liftIO $ createDirectoryIfMissing True dir
|
liftIO $ createDirectoryIfMissing True dir
|
||||||
firstrun lck
|
firstrun lck
|
||||||
a
|
a
|
||||||
|
|
|
@ -125,9 +125,9 @@ rsyncParamsRemote r direction key file afile = do
|
||||||
-- Convert the ssh command into rsync command line.
|
-- Convert the ssh command into rsync command line.
|
||||||
let eparam = rsyncShell (Param shellcmd:shellparams)
|
let eparam = rsyncShell (Param shellcmd:shellparams)
|
||||||
let o = rsyncParams r
|
let o = rsyncParams r
|
||||||
if direction == Download
|
return $ if direction == Download
|
||||||
then return $ o ++ rsyncopts eparam dummy (File file)
|
then o ++ rsyncopts eparam dummy (File file)
|
||||||
else return $ o ++ rsyncopts eparam (File file) dummy
|
else o ++ rsyncopts eparam (File file) dummy
|
||||||
where
|
where
|
||||||
rsyncopts ps source dest
|
rsyncopts ps source dest
|
||||||
| end ps == [dashdash] = 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
|
-- --inplace to resume partial files
|
||||||
rsyncParams :: Remote -> [CommandParam]
|
rsyncParams :: Remote -> [CommandParam]
|
||||||
rsyncParams r = [Params "--progress --inplace"] ++
|
rsyncParams r = Params "--progress --inplace" :
|
||||||
map Param (remoteAnnexRsyncOptions $ gitconfig r)
|
map Param (remoteAnnexRsyncOptions $ gitconfig r)
|
||||||
|
|
||||||
|
|
|
@ -93,7 +93,7 @@ lookupHook hookname action = do
|
||||||
command <- getConfig (annexConfig hook) ""
|
command <- getConfig (annexConfig hook) ""
|
||||||
if null command
|
if null command
|
||||||
then do
|
then do
|
||||||
fallback <- getConfig (annexConfig $ hookfallback) ""
|
fallback <- getConfig (annexConfig hookfallback) ""
|
||||||
if null fallback
|
if null fallback
|
||||||
then do
|
then do
|
||||||
warning $ "missing configuration for " ++ hook ++ " or " ++ hookfallback
|
warning $ "missing configuration for " ++ hook ++ " or " ++ hookfallback
|
||||||
|
|
|
@ -80,7 +80,7 @@ remoteListRefresh = do
|
||||||
remoteList
|
remoteList
|
||||||
|
|
||||||
{- Generates a Remote. -}
|
{- Generates a Remote. -}
|
||||||
remoteGen :: (M.Map UUID RemoteConfig) -> RemoteType -> Git.Repo -> Annex (Maybe Remote)
|
remoteGen :: M.Map UUID RemoteConfig -> RemoteType -> Git.Repo -> Annex (Maybe Remote)
|
||||||
remoteGen m t r = do
|
remoteGen m t r = do
|
||||||
u <- getRepoUUID r
|
u <- getRepoUUID r
|
||||||
g <- fromRepo id
|
g <- fromRepo id
|
||||||
|
|
|
@ -86,7 +86,7 @@ gen r u c gc = do
|
||||||
then Just $ rsyncUrl o
|
then Just $ rsyncUrl o
|
||||||
else Nothing
|
else Nothing
|
||||||
, readonly = False
|
, readonly = False
|
||||||
, globallyAvailable = not $ islocal
|
, globallyAvailable = not islocal
|
||||||
, remotetype = remote
|
, remotetype = remote
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -262,7 +262,7 @@ rsyncRetrieve o k dest callback =
|
||||||
, File dest
|
, File dest
|
||||||
]
|
]
|
||||||
|
|
||||||
rsyncRemote :: RsyncOpts -> (Maybe MeterUpdate) -> [CommandParam] -> Annex Bool
|
rsyncRemote :: RsyncOpts -> Maybe MeterUpdate -> [CommandParam] -> Annex Bool
|
||||||
rsyncRemote o callback params = do
|
rsyncRemote o callback params = do
|
||||||
showOutput -- make way for progress bar
|
showOutput -- make way for progress bar
|
||||||
ifM (liftIO $ (maybe rsync rsyncProgress callback) ps)
|
ifM (liftIO $ (maybe rsync rsyncProgress callback) ps)
|
||||||
|
|
|
@ -181,9 +181,9 @@ checkPresent r k = davAction r noconn go
|
||||||
- or perhaps this was an intermittent error. -}
|
- or perhaps this was an intermittent error. -}
|
||||||
onerr url = do
|
onerr url = do
|
||||||
v <- davUrlExists url user pass
|
v <- davUrlExists url user pass
|
||||||
if v == Right True
|
return $ if v == Right True
|
||||||
then return $ Left $ "failed to read " ++ url
|
then Left $ "failed to read " ++ url
|
||||||
else return v
|
else v
|
||||||
|
|
||||||
withStoredFiles
|
withStoredFiles
|
||||||
:: Remote
|
:: Remote
|
||||||
|
|
|
@ -77,7 +77,7 @@ preferredContent ClientGroup = lastResort $
|
||||||
preferredContent TransferGroup = lastResort $
|
preferredContent TransferGroup = lastResort $
|
||||||
"not (inallgroup=client and copies=client:2) and (" ++ preferredContent ClientGroup ++ ")"
|
"not (inallgroup=client and copies=client:2) and (" ++ preferredContent ClientGroup ++ ")"
|
||||||
preferredContent BackupGroup = "include=*"
|
preferredContent BackupGroup = "include=*"
|
||||||
preferredContent IncrementalBackupGroup = lastResort $
|
preferredContent IncrementalBackupGroup = lastResort
|
||||||
"include=* and (not copies=incrementalbackup:1)"
|
"include=* and (not copies=incrementalbackup:1)"
|
||||||
preferredContent SmallArchiveGroup = lastResort $
|
preferredContent SmallArchiveGroup = lastResort $
|
||||||
"(include=*/archive/* or include=archive/*) and (" ++ preferredContent FullArchiveGroup ++ ")"
|
"(include=*/archive/* or include=archive/*) and (" ++ preferredContent FullArchiveGroup ++ ")"
|
||||||
|
|
|
@ -107,7 +107,7 @@ moveLocationLogs = do
|
||||||
dir <- fromRepo Upgrade.V2.gitStateDir
|
dir <- fromRepo Upgrade.V2.gitStateDir
|
||||||
ifM (liftIO $ doesDirectoryExist dir)
|
ifM (liftIO $ doesDirectoryExist dir)
|
||||||
( mapMaybe oldlog2key
|
( mapMaybe oldlog2key
|
||||||
<$> (liftIO $ getDirectoryContents dir)
|
<$> liftIO (getDirectoryContents dir)
|
||||||
, return []
|
, return []
|
||||||
)
|
)
|
||||||
move (l, k) = do
|
move (l, k) = do
|
||||||
|
|
Loading…
Reference in a new issue