mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 22:12:43 +01:00
* Refactoring: move all database manipulation into store.cc.
* Removed `--query --generators'.
This commit is contained in:
parent
5fc7127643
commit
ebff82222c
10 changed files with 143 additions and 170 deletions
11
src/expr.cc
11
src/expr.cc
|
|
@ -39,14 +39,11 @@ Path writeTerm(ATerm t, const string & suffix)
|
|||
(string) h + suffix + ".nix");
|
||||
|
||||
if (!isValidPath(path)) {
|
||||
if (!ATwriteToNamedTextFile(t, path.c_str()))
|
||||
throw Error(format("cannot write aterm %1%") % path);
|
||||
|
||||
Transaction txn(nixDB);
|
||||
registerValidPath(txn, path);
|
||||
txn.commit();
|
||||
char * s = ATwriteToString(t);
|
||||
if (!s) throw Error(format("cannot write aterm to `%1%'") % path);
|
||||
addTextToStore(path, string(s));
|
||||
}
|
||||
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue