if keys database cannot be opened due to permissions, ignore

This lets readonly repos be used. If a repo is readonly, we can ignore the
keys database, because nothing that we can do will change the state of the
repo anyway.
This commit is contained in:
Joey Hess 2016-02-12 14:15:28 -04:00
parent 0983f136b8
commit 9df13e73ae
Failed to extract signature
5 changed files with 33 additions and 7 deletions

View file

@ -26,8 +26,8 @@ import Prelude
newtype DbHandle = DbHandle (MVar DbState)
-- The database can be closed or open, but it also may have been
-- tried to open (for read) and didn't exist yet.
data DbState = DbClosed | DbOpen H.DbQueue | DbEmpty
-- tried to open (for read) and didn't exist yet or is not readable.
data DbState = DbClosed | DbOpen H.DbQueue | DbUnavailable
newDbHandle :: IO DbHandle
newDbHandle = DbHandle <$> newMVar DbClosed