* toFile: maintain the references.

This commit is contained in:
Eelco Dolstra 2006-10-19 17:39:02 +00:00
parent b3d3700e11
commit 9bd93f7606

View file

@ -370,17 +370,11 @@ static Expr primToFile(EvalState & state, const ATermVector & args)
PathSet refs; PathSet refs;
#if 0 for (PathSet::iterator i = context.begin(); i != context.end(); ++i) {
/* !!! */ if (isDerivation(*i))
for (ATermIterator i(context); i; ++i) { throw EvalError("in `toFile': the file cannot refer to derivation outputs");
ATerm s; refs.insert(*i);
if (matchPath(*i, s)) {
assert(isStorePath(aterm2String(s)));
refs.insert(aterm2String(s));
} }
else throw EvalError("in `toFile': the file cannot contain references to derivation outputs");
}
#endif
Path storePath = addTextToStore(name, contents, refs); Path storePath = addTextToStore(name, contents, refs);