diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-15T12·42+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2003-10-15T12·42+0000 |
commit | ebff82222c7b946e70e539389c0027529b6c7ad0 (patch) | |
tree | 4f3352f66c91f6f21ef47b1b07f763f4be0ffeb0 /src/expr.cc | |
parent | 5fc71276430e8e6a4588fa54da692f81d5ada585 (diff) |
* Refactoring: move all database manipulation into store.cc.
* Removed `--query --generators'.
Diffstat (limited to 'src/expr.cc')
-rw-r--r-- | src/expr.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/expr.cc b/src/expr.cc index 521dffc9c693..cfc4af1f39a8 100644 --- a/src/expr.cc +++ b/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; } |