annex.dbdir fully working

Completes work started in e60766543f

I've verified that all the sqlite databases get stored in annex.dbdir
and are created successfully. If annex.dbdir does not exist, it will be
created; its parent directory must already exist though.

Sponsored-by: Dartmouth College's Datalad project
This commit is contained in:
Joey Hess 2022-08-12 12:56:56 -04:00
parent 23c6e350cb
commit a335c1e46e
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
3 changed files with 12 additions and 8 deletions

View file

@ -36,11 +36,12 @@ initDb db migration = do
let tmpdb = tmpdbdir P.</> "db"
let tdb = T.pack (fromRawFilePath tmpdb)
gc <- Annex.getGitConfig
top <- case annexDbDir gc of
Just topdbdir -> pure $ parentDir $ topdbdir
Nothing -> parentDir <$> fromRepo gitAnnexDir
top <- parentDir <$> fromRepo gitAnnexDir
let tops = case annexDbDir gc of
Just topdbdir -> [top, parentDir topdbdir]
Nothing -> [top]
liftIO $ do
createDirectoryUnder [top] tmpdbdir
createDirectoryUnder tops tmpdbdir
runSqliteInfo (enableWAL tdb) migration
setAnnexDirPerm tmpdbdir
-- Work around sqlite bug that prevents it from honoring