mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-23 06:26:15 +02:00
* Support read-only access to the database.
This commit is contained in:
parent
e33f67ff0b
commit
af565c348a
1 changed files with 5 additions and 1 deletions
|
@ -173,7 +173,10 @@ LocalStore::LocalStore()
|
||||||
|
|
||||||
schemaPath = nixDBPath + "/schema";
|
schemaPath = nixDBPath + "/schema";
|
||||||
|
|
||||||
if (readOnlyMode) return;
|
if (readOnlyMode) {
|
||||||
|
openDB(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create missing state directories if they don't already exist. */
|
/* Create missing state directories if they don't already exist. */
|
||||||
createDirs(nixStore);
|
createDirs(nixStore);
|
||||||
|
@ -197,6 +200,7 @@ LocalStore::LocalStore()
|
||||||
} catch (SysError & e) {
|
} catch (SysError & e) {
|
||||||
if (e.errNo != EACCES) throw;
|
if (e.errNo != EACCES) throw;
|
||||||
readOnlyMode = true;
|
readOnlyMode = true;
|
||||||
|
openDB(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue