convert KeySource to RawFilePath

This commit is contained in:
Joey Hess 2020-02-21 09:34:59 -04:00
parent e468fbc518
commit c31e1be781
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
14 changed files with 74 additions and 55 deletions

View file

@ -16,6 +16,7 @@ import Git.FilePath
import Utility.Metered
import qualified Data.ByteString.Char8 as S8
import qualified Utility.RawFilePath as R
backends :: [Backend]
backends = [backend]
@ -36,10 +37,10 @@ backend = Backend
keyValue :: KeySource -> MeterUpdate -> Annex (Maybe Key)
keyValue source _ = do
let f = contentLocation source
stat <- liftIO $ getFileStatus f
sz <- liftIO $ getFileSize' f stat
stat <- liftIO $ R.getFileStatus f
sz <- liftIO $ getFileSize' (fromRawFilePath f) stat
relf <- fromRawFilePath . getTopFilePath
<$> inRepo (toTopFilePath $ toRawFilePath $ keyFilename source)
<$> inRepo (toTopFilePath $ keyFilename source)
return $ Just $ mkKey $ \k -> k
{ keyName = genKeyName relf
, keyVariety = WORMKey