more OsPath conversion

Sponsored-by: k0ld
This commit is contained in:
Joey Hess 2025-02-01 14:06:38 -04:00
parent 474cf3bc8b
commit 71195cce13
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
33 changed files with 198 additions and 194 deletions

View file

@ -47,11 +47,9 @@ import Git.FilePath
import qualified Git.DiffTree as DiffTree
import Logs
import qualified Logs.ContentIdentifier as Log
import qualified Utility.RawFilePath as R
import Database.Persist.Sql hiding (Key)
import Database.Persist.TH
import qualified System.FilePath.ByteString as P
#if MIN_VERSION_persistent_sqlite(2,13,3)
import Database.RawFilePath
@ -99,14 +97,14 @@ openDb :: Annex ContentIdentifierHandle
openDb = do
dbdir <- calcRepo' gitAnnexContentIdentifierDbDir
let db = dbdir </> literalOsPath "db"
isnew <- liftIO $ not <$> doesDirectoryPathExist db
isnew <- liftIO $ not <$> doesDirectoryExist db
if isnew
then initDb db $ void $
runMigrationSilent migrateContentIdentifier
-- Migrate from old versions of database, which had buggy
-- and suboptimal uniqueness constraints.
#if MIN_VERSION_persistent_sqlite(2,13,3)
else liftIO $ runSqlite' db $ void $
else liftIO $ runSqlite' (fromOsPath db) $ void $
runMigrationSilent migrateContentIdentifier
#else
else liftIO $ runSqlite (T.pack (fromRawFilePath db)) $ void $