1
1
Fork 0
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:
Eelco Dolstra 2003-10-15 12:42:39 +00:00
parent 5fc7127643
commit ebff82222c
10 changed files with 143 additions and 170 deletions

View file

@ -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;
}