diff options
author | Joey Hess <joey@kitenet.net> | 2012-01-20 13:23:11 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2012-01-20 13:23:11 -0400 |
commit | 61dbad505d648f13394018c31ce2d718c175007e (patch) | |
tree | 96f087d5ec3e3eab6cf45b5a7d49cfb2b0dfa7f7 /Remote/Bup.hs | |
parent | e96726caa31fd76413b450790860611f71d13915 (diff) |
fsck --from remote --fast
Avoids expensive file transfers, at the expense of checking file size
and/or contents.
Required some reworking of the remote code.
Diffstat (limited to 'Remote/Bup.hs')
-rw-r--r-- | Remote/Bup.hs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Remote/Bup.hs b/Remote/Bup.hs index 9a20d9e60..7329167da 100644 --- a/Remote/Bup.hs +++ b/Remote/Bup.hs @@ -50,6 +50,7 @@ gen r u c = do name = Git.repoDescribe r, storeKey = store r buprepo, retrieveKeyFile = retrieve buprepo, + retrieveKeyFileCheap = retrieveCheap buprepo, removeKey = remove, hasKey = checkPresent r bupr', hasKeyCheap = bupLocal buprepo, @@ -118,13 +119,16 @@ storeEncrypted r buprepo (cipher, enck) k = do withEncryptedHandle cipher (L.readFile src) $ \h -> pipeBup params (Just h) Nothing -retrieve :: BupRepo -> Key -> Bool -> FilePath -> Annex Bool -retrieve buprepo k _ f = do +retrieve :: BupRepo -> Key -> FilePath -> Annex Bool +retrieve buprepo k f = do let params = bupParams "join" buprepo [Param $ show k] liftIO $ catchBoolIO $ do tofile <- openFile f WriteMode pipeBup params Nothing (Just tofile) +retrieveCheap :: BupRepo -> Key -> FilePath -> Annex Bool +retrieveCheap _ _ _ = return False + retrieveEncrypted :: BupRepo -> (Cipher, Key) -> FilePath -> Annex Bool retrieveEncrypted buprepo (cipher, enck) f = do let params = bupParams "join" buprepo [Param $ show enck] |