diff --git a/Annex/Content.hs b/Annex/Content.hs index 9c5d01cd83..995eb6ed15 100644 --- a/Annex/Content.hs +++ b/Annex/Content.hs @@ -751,7 +751,7 @@ downloadUrl :: Bool -> Key -> MeterUpdate -> Maybe IncrementalVerifier -> [Url.U downloadUrl listfailedurls k p iv urls file uo = -- Poll the file to handle configurations where an external -- download command is used. - meteredFile file (Just p) k (go urls []) + meteredFile (toRawFilePath file) (Just p) k (go urls []) where go (u:us) errs p' = Url.download' p' iv u file uo >>= \case Right () -> return True diff --git a/Annex/CopyFile.hs b/Annex/CopyFile.hs index 176f71c076..55c7d908e2 100644 --- a/Annex/CopyFile.hs +++ b/Annex/CopyFile.hs @@ -57,7 +57,7 @@ tryCopyCoW (CopyCoWTried copycowtried) src dest meterupdate = ) ) where - docopycow = watchFileSize dest meterupdate $ const $ + docopycow = watchFileSize dest' meterupdate $ const $ copyCoW CopyTimeStamps src dest dest' = toRawFilePath dest diff --git a/Messages/Progress.hs b/Messages/Progress.hs index 6392f12fa2..c726149d18 100644 --- a/Messages/Progress.hs +++ b/Messages/Progress.hs @@ -171,7 +171,7 @@ metered' st setclear othermeterupdate msize bwlimit showoutput a = go st minratelimit = min consoleratelimit jsonratelimit {- Poll file size to display meter. -} -meteredFile :: FilePath -> Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a +meteredFile :: RawFilePath -> Maybe MeterUpdate -> Key -> (MeterUpdate -> Annex a) -> Annex a meteredFile file combinemeterupdate key a = metered combinemeterupdate key Nothing $ \_ p -> watchFileSize file p a diff --git a/Utility/Metered.hs b/Utility/Metered.hs index b97516cb1a..0b7097b732 100644 --- a/Utility/Metered.hs +++ b/Utility/Metered.hs @@ -227,7 +227,7 @@ defaultChunkSize = 32 * k - chunkOverhead -} watchFileSize :: (MonadIO m, MonadMask m) - => FilePath + => RawFilePath -> MeterUpdate -> (MeterUpdate -> m a) -> m a @@ -245,8 +245,7 @@ watchFileSize f p a = do p' sz watcher p' sz getsz = catchDefaultIO zeroBytesProcessed $ - toBytesProcessed <$> getFileSize f' - f' = toRawFilePath f + toBytesProcessed <$> getFileSize f meterupdate sizevar preventbacktracking n | preventbacktracking = do