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
|
@ -19,6 +19,7 @@ import Annex.Common
|
|||
import Utility.TimeStamp
|
||||
import Logs.File
|
||||
import Types.RepoVersion
|
||||
import qualified Utility.FileIO as F
|
||||
|
||||
import Data.Time.Clock.POSIX
|
||||
|
||||
|
@ -31,10 +32,10 @@ writeUpgradeLog v t = do
|
|||
|
||||
readUpgradeLog :: Annex [(RepoVersion, POSIXTime)]
|
||||
readUpgradeLog = do
|
||||
logfile <- fromRawFilePath <$> fromRepo gitAnnexUpgradeLog
|
||||
ifM (liftIO $ doesFileExist logfile)
|
||||
( mapMaybe parse . lines
|
||||
<$> liftIO (readFileStrict logfile)
|
||||
logfile <- fromRepo gitAnnexUpgradeLog
|
||||
ifM (liftIO $ doesFileExist (fromRawFilePath logfile))
|
||||
( mapMaybe (parse . decodeBS) . fileLines'
|
||||
<$> liftIO (F.readFile' (toOsPath logfile))
|
||||
, return []
|
||||
)
|
||||
where
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue