mirror of
https://github.com/NixOS/nix
synced 2025-06-28 05:21:16 +02:00
Merge pull request #1333 from copumpkin/fix-schema-version
Ensure that curSchema is set before opening the DB
This commit is contained in:
commit
1ab5cc0f5a
1 changed files with 2 additions and 0 deletions
|
@ -225,6 +225,7 @@ LocalStore::LocalStore(bool reserveSpace)
|
||||||
schemaPath = settings.nixDBPath + "/schema";
|
schemaPath = settings.nixDBPath + "/schema";
|
||||||
|
|
||||||
if (settings.readOnlyMode) {
|
if (settings.readOnlyMode) {
|
||||||
|
curSchema = getSchema();
|
||||||
openDB(false);
|
openDB(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -309,6 +310,7 @@ LocalStore::LocalStore(bool reserveSpace)
|
||||||
} catch (SysError & e) {
|
} catch (SysError & e) {
|
||||||
if (e.errNo != EACCES) throw;
|
if (e.errNo != EACCES) throw;
|
||||||
settings.readOnlyMode = true;
|
settings.readOnlyMode = true;
|
||||||
|
curSchema = getSchema();
|
||||||
openDB(false);
|
openDB(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue