more OsPath conversion
Sponsored-by: Jack Hill
This commit is contained in:
parent
a03c609268
commit
c69e57aede
17 changed files with 83 additions and 91 deletions
|
@ -98,8 +98,8 @@ AnnexBranch
|
|||
openDb :: Annex ContentIdentifierHandle
|
||||
openDb = do
|
||||
dbdir <- calcRepo' gitAnnexContentIdentifierDbDir
|
||||
let db = dbdir P.</> "db"
|
||||
isnew <- liftIO $ not <$> R.doesPathExist db
|
||||
let db = dbdir </> literalOsPath "db"
|
||||
isnew <- liftIO $ not <$> doesDirectoryPathExist db
|
||||
if isnew
|
||||
then initDb db $ void $
|
||||
runMigrationSilent migrateContentIdentifier
|
||||
|
|
|
@ -33,12 +33,10 @@ import Annex.Locations
|
|||
import Utility.Exception
|
||||
import Annex.Common
|
||||
import Annex.LockFile
|
||||
import qualified Utility.RawFilePath as R
|
||||
|
||||
import Database.Persist.Sql hiding (Key)
|
||||
import Database.Persist.TH
|
||||
import Data.Time.Clock
|
||||
import qualified System.FilePath.ByteString as P
|
||||
|
||||
data FsckHandle = FsckHandle H.DbQueue UUID
|
||||
|
||||
|
@ -66,14 +64,14 @@ newPass u = do
|
|||
go = do
|
||||
removedb =<< calcRepo' (gitAnnexFsckDbDir u)
|
||||
removedb =<< calcRepo' (gitAnnexFsckDbDirOld u)
|
||||
removedb = liftIO . void . tryIO . removeDirectoryRecursive . fromRawFilePath
|
||||
removedb = liftIO . void . tryIO . removeDirectoryRecursive
|
||||
|
||||
{- Opens the database, creating it if it doesn't exist yet. -}
|
||||
openDb :: UUID -> Annex FsckHandle
|
||||
openDb u = do
|
||||
dbdir <- calcRepo' (gitAnnexFsckDbDir u)
|
||||
let db = dbdir P.</> "db"
|
||||
unlessM (liftIO $ R.doesPathExist db) $ do
|
||||
let db = dbdir </> literalOsPath "db"
|
||||
unlessM (liftIO $ doesDirectoryExist db) $ do
|
||||
initDb db $ void $
|
||||
runMigrationSilent migrateFsck
|
||||
lockFileCached =<< calcRepo' (gitAnnexFsckDbLock u)
|
||||
|
|
|
@ -42,11 +42,9 @@ import Database.Utility
|
|||
import Database.Types
|
||||
import Annex.LockFile
|
||||
import Git.Types
|
||||
import qualified Utility.RawFilePath as R
|
||||
|
||||
import Database.Persist.Sql hiding (Key)
|
||||
import Database.Persist.TH
|
||||
import qualified System.FilePath.ByteString as P
|
||||
import qualified Data.Map.Strict as M
|
||||
import qualified Data.Set as S
|
||||
import Control.Exception
|
||||
|
@ -107,8 +105,8 @@ getRepoSizeHandle = Annex.getState Annex.reposizehandle >>= \case
|
|||
openDb :: Annex RepoSizeHandle
|
||||
openDb = lockDbWhile permerr $ do
|
||||
dbdir <- calcRepo' gitAnnexRepoSizeDbDir
|
||||
let db = dbdir P.</> "db"
|
||||
unlessM (liftIO $ R.doesPathExist db) $ do
|
||||
let db = dbdir </> literalOsPath "db"
|
||||
unlessM (liftIO $ doesDirectoryExist db) $ do
|
||||
initDb db $ void $
|
||||
runMigrationSilent migrateRepoSizes
|
||||
h <- liftIO $ H.openDb db "repo_sizes"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue