RawFilePath conversion
authorJoey Hess <joeyh@joeyh.name>
Fri, 19 Jan 2024 18:26:21 +0000 (14:26 -0400)
committerJoey Hess <joeyh@joeyh.name>
Fri, 19 Jan 2024 18:26:21 +0000 (14:26 -0400)
Sponsored-by: Dartmouth College's DANDI project
Annex/Content.hs
Annex/CopyFile.hs
Messages/Progress.hs
Utility/Metered.hs

index 9c5d01cd83f27aba5434113b6d56c6febd39070f..995eb6ed15cfac31a44f97bbc293e49e88dd5634 100644 (file)
@@ -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
index 176f71c07691f77edf7b687680dda5ad19953417..55c7d908e27824507268094e0011c39cc04a4bcf 100644 (file)
@@ -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
index 6392f12fa2da993becc168c03861da54d8a1ea4b..c726149d1813230f8a0ecbc6951eec5eea2c1f51 100644 (file)
@@ -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
index b97516cb1a8bdf26226c2c74c126e429d72a8b08..0b7097b7321379277ba14e08b5a3acd0dc93cd25 100644 (file)
@@ -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