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.
This commit is contained in:
parent
fb8fec2a7b
commit
6dad09a823
2 changed files with 8 additions and 4 deletions
|
@ -8,6 +8,7 @@
|
|||
module Remote.Helper.Chunked (
|
||||
ChunkSize,
|
||||
ChunkConfig(..),
|
||||
noChunks,
|
||||
describeChunkConfig,
|
||||
getChunkConfig,
|
||||
storeChunks,
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue