use RawFilePath version of rename
Some small wins, almost certianly swamped by the system calls, but still worthwhile progress on the RawFilePath conversion. Sponsored-by: Erik Bjäreholt on Patreon
This commit is contained in:
parent
d00e23cac9
commit
debcf86029
16 changed files with 58 additions and 54 deletions
|
@ -407,7 +407,7 @@ retrieveExportWithContentIdentifierM borgrepo loc _ dest gk _ = do
|
|||
forceSuccessProcess p pid
|
||||
-- Filepaths in borg archives are relative, so it's ok to
|
||||
-- combine with </>
|
||||
moveFile (fromRawFilePath othertmp </> fromRawFilePath archivefile) dest
|
||||
moveFile (othertmp P.</> archivefile) (toRawFilePath dest)
|
||||
removeDirectoryRecursive (fromRawFilePath othertmp)
|
||||
|
||||
(archivename, archivefile) = extractImportLocation loc
|
||||
|
|
|
@ -403,7 +403,7 @@ writeRetrievedContent
|
|||
writeRetrievedContent dest enc encc mh mp content miv = case (enc, mh, content) of
|
||||
(Nothing, Nothing, FileContent f)
|
||||
| f == dest -> noop
|
||||
| otherwise -> liftIO $ moveFile f dest
|
||||
| otherwise -> liftIO $ moveFile (toRawFilePath f) (toRawFilePath dest)
|
||||
(Just (cipher, _), _, ByteContent b) -> do
|
||||
cmd <- gpgCmd <$> Annex.getGitConfig
|
||||
decrypt cmd encc cipher (feedBytes b) $
|
||||
|
|
|
@ -226,7 +226,7 @@ store o k src meterupdate = storeGeneric o meterupdate basedest populatedest
|
|||
then do
|
||||
rename src dest
|
||||
return True
|
||||
else createLinkOrCopy src dest
|
||||
else createLinkOrCopy (toRawFilePath src) (toRawFilePath dest)
|
||||
{- If the key being sent is encrypted or chunked, the file
|
||||
- containing its content is a temp file, and so can be
|
||||
- renamed into place. Otherwise, the file is the annexed
|
||||
|
@ -315,7 +315,7 @@ storeExportM o src _k loc meterupdate =
|
|||
storeGeneric o meterupdate basedest populatedest
|
||||
where
|
||||
basedest = fromRawFilePath (fromExportLocation loc)
|
||||
populatedest = liftIO . createLinkOrCopy src
|
||||
populatedest = liftIO . createLinkOrCopy (toRawFilePath src) . toRawFilePath
|
||||
|
||||
retrieveExportM :: RsyncOpts -> Key -> ExportLocation -> FilePath -> MeterUpdate -> Annex Verification
|
||||
retrieveExportM o k loc dest p =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue