diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-08-19 14:13:19 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-08-19 14:16:01 -0400 |
commit | c4e9c34f3022ab6f4bcc0ad6f860bbd68fe97e50 (patch) | |
tree | 117963ca764616b5f4738a48866626d876badb1d /Remote/Helper/Special.hs | |
parent | b742823f8ffbadf1a23b7ea393201b5811cb850e (diff) |
disable whereisKey for encrypted or chunked remotes
This only makes sense for public repos, that are not chunked, so
that there's a 1:1 from Key in the git-annex repo to file on the remote.
Rather than making every remote implementation deal with that, just disable
whereisKey when it doesn't make sense.
Diffstat (limited to 'Remote/Helper/Special.hs')
-rw-r--r-- | Remote/Helper/Special.hs | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/Remote/Helper/Special.hs b/Remote/Helper/Special.hs index 60bf123a5..42827e5f7 100644 --- a/Remote/Helper/Special.hs +++ b/Remote/Helper/Special.hs @@ -162,18 +162,21 @@ specialRemote' cfg c preparestorer prepareretriever prepareremover preparecheckp (\_ -> return False) , removeKey = \k -> cip >>= removeKeyGen k , checkPresent = \k -> cip >>= checkPresentGen k - , cost = maybe - (cost baser) - (const $ cost baser + encryptedRemoteCostAdj) - (extractCipher c) + , cost = if isencrypted + then cost baser + encryptedRemoteCostAdj + else cost baser , getInfo = do l <- getInfo baser return $ l ++ [ ("encryption", describeEncryption c) , ("chunking", describeChunkConfig (chunkConfig cfg)) ] + , whereisKey = if noChunks (chunkConfig cfg) && not isencrypted + then whereisKey baser + else Nothing } cip = cipherKey c + isencrypted = isJust (extractCipher c) gpgopts = getGpgEncParams encr safely a = catchNonAsync a (\e -> warning (show e) >> return False) |