convert from readFileStrict
This removes that function, using file-io readFile' instead. Had to deal with newline conversion, which readFileStrict does on Windows. In a few cases, that was pretty ugly to deal with. Sponsored-by: Kevin Mueller
This commit is contained in:
parent
de1af273e0
commit
6e27b0d4d1
19 changed files with 94 additions and 71 deletions
|
@ -32,6 +32,7 @@ import qualified Data.Map as M
|
|||
import qualified Data.Set as S
|
||||
import Data.Time.Clock.POSIX
|
||||
import Data.Time
|
||||
import qualified Utility.FileIO as F
|
||||
|
||||
import Annex.Common
|
||||
import qualified Annex
|
||||
|
@ -73,10 +74,10 @@ writeUnusedLog prefix l = do
|
|||
|
||||
readUnusedLog :: RawFilePath -> Annex UnusedLog
|
||||
readUnusedLog prefix = do
|
||||
f <- fromRawFilePath <$> fromRepo (gitAnnexUnusedLog prefix)
|
||||
ifM (liftIO $ doesFileExist f)
|
||||
( M.fromList . mapMaybe parse . lines
|
||||
<$> liftIO (readFileStrict f)
|
||||
f <- fromRepo (gitAnnexUnusedLog prefix)
|
||||
ifM (liftIO $ doesFileExist (fromRawFilePath f))
|
||||
( M.fromList . mapMaybe (parse . decodeBS) . fileLines'
|
||||
<$> liftIO (F.readFile' (toOsPath f))
|
||||
, return M.empty
|
||||
)
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue