* Allow certain operations to succeed even if we don't have write
permission to the Nix store or database. E.g., `nix-env -qa' will work, but `nix-env -qas' won't (the latter needs DB access). The option `--readonly-mode' forces this mode; otherwise, it's only activated when the database cannot be opened.
This commit is contained in:
parent
3ade3e7721
commit
f4d44a0026
9 changed files with 58 additions and 16 deletions
|
|
@ -17,7 +17,7 @@ Path writeTerm(ATerm t, const string & suffix)
|
|||
Path path = canonPath(nixStore + "/" +
|
||||
(string) h + suffix + ".store");
|
||||
|
||||
if (!isValidPath(path)) {
|
||||
if (!readOnlyMode && !isValidPath(path)) {
|
||||
char * s = ATwriteToString(t);
|
||||
if (!s) throw Error(format("cannot write aterm to `%1%'") % path);
|
||||
addTextToStore(path, string(s));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue