more RawFilePath conversion

This commit was sponsored by Luke Shumaker on Patreon.
This commit is contained in:
Joey Hess 2020-11-02 16:31:28 -04:00
parent b724236b35
commit 55400a03d3
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
22 changed files with 91 additions and 79 deletions

View file

@ -21,7 +21,7 @@ seek = withWords (commandAction . start)
start :: [String] -> CommandStart
start ps@(keyname:file:[]) = starting "setkey" ai si $
perform file (keyOpt keyname)
perform (toRawFilePath file) (keyOpt keyname)
where
ai = ActionItemOther (Just file)
si = SeekInput ps
@ -30,7 +30,7 @@ start _ = giveup "specify a key and a content file"
keyOpt :: String -> Key
keyOpt = fromMaybe (giveup "bad key") . deserializeKey
perform :: FilePath -> Key -> CommandPerform
perform :: RawFilePath -> Key -> CommandPerform
perform file key = do
-- the file might be on a different filesystem, so moveFile is used
-- rather than simply calling moveAnnex; disk space is also
@ -38,7 +38,7 @@ perform file key = do
ok <- getViaTmp RetrievalAllKeysSecure DefaultVerify key $ \dest -> unVerified $
if dest /= file
then liftIO $ catchBoolIO $ do
moveFile file dest
moveFile (fromRawFilePath file) (fromRawFilePath dest)
return True
else return True
if ok