1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-29 23:13:14 +02:00

* Put building in the store API.

This commit is contained in:
Eelco Dolstra 2006-11-30 18:02:04 +00:00
parent e2ef5e07fd
commit 6ecb840fd1
11 changed files with 31 additions and 48 deletions

View file

@ -1,6 +1,5 @@
#include "misc.hh"
#include "store-api.hh"
#include "build.hh"
#include "db.hh"
#include <aterm2.h>
@ -12,7 +11,7 @@ namespace nix {
Derivation derivationFromPath(const Path & drvPath)
{
assertStorePath(drvPath);
ensurePath(drvPath);
store->ensurePath(drvPath);
ATerm t = ATreadFromNamedFile(drvPath.c_str());
if (!t) throw Error(format("cannot read aterm from `%1%'") % drvPath);
return parseDerivation(t);