From 3e41a8f032fe78b0ff8aac9a194ac0896e5742ac Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 12 Mar 2021 15:16:23 -0400 Subject: [PATCH] move move use of into DavLocation so it always uses unix filepaths due to imports --- Remote/WebDAV.hs | 2 +- Remote/WebDAV/DavLocation.hs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Remote/WebDAV.hs b/Remote/WebDAV.hs index 54b2c783c6..31960f2b01 100644 --- a/Remote/WebDAV.hs +++ b/Remote/WebDAV.hs @@ -212,7 +212,7 @@ storeExportDav :: DavHandleVar -> FilePath -> Key -> ExportLocation -> MeterUpda storeExportDav hdl f k loc p = case exportLocation loc of Right dest -> withDavHandle hdl $ \h -> runExport h $ \dav -> do reqbody <- liftIO $ httpBodyStorer f p - storeHelper dav (takeDirectory dest keyTmpLocation k) dest reqbody + storeHelper dav (exportTmpLocation loc k) dest reqbody Left err -> giveup err retrieveExportDav :: DavHandleVar -> Key -> ExportLocation -> FilePath -> MeterUpdate -> Annex () diff --git a/Remote/WebDAV/DavLocation.hs b/Remote/WebDAV/DavLocation.hs index bd188a6de4..99c2c61ea7 100644 --- a/Remote/WebDAV/DavLocation.hs +++ b/Remote/WebDAV/DavLocation.hs @@ -62,6 +62,11 @@ exportLocation l = keyTmpLocation :: Key -> DavLocation keyTmpLocation = tmpLocation . fromRawFilePath . keyFile +exportTmpLocation :: ExportLocation -> Key -> DavLocation +exportTmpLocation l k = d keyTmpLocation k + where + d = takeDirectory (fromRawFilePath (fromExportLocation l)) + tmpLocation :: FilePath -> DavLocation tmpLocation f = "git-annex-webdav-tmp-" ++ f