Generate shorter keys for WORM and URL, avoiding keys that are longer than used for SHA256, so as to not break on systems like Windows that have very small maximum path length limits.

This commit is contained in:
Joey Hess 2015-01-06 17:58:57 -04:00
parent ae14354686
commit c0f2b992ed
4 changed files with 24 additions and 19 deletions

View file

@ -34,9 +34,8 @@ keyValue :: KeySource -> Annex (Maybe Key)
keyValue source = do
stat <- liftIO $ getFileStatus $ contentLocation source
relf <- getTopFilePath <$> inRepo (toTopFilePath $ keyFilename source)
n <- genKeyName relf
return $ Just $ stubKey
{ keyName = n
{ keyName = genKeyName relf
, keyBackendName = name backend
, keySize = Just $ fromIntegral $ fileSize stat
, keyMtime = Just $ modificationTime stat