* 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;
#if 0
/* !!! */
for (ATermIterator i(context); i; ++i) {
ATerm s;
if (matchPath(*i, s)) {
assert(isStorePath(aterm2String(s)));
refs.insert(aterm2String(s));
for (PathSet::iterator i = context.begin(); i != context.end(); ++i) {
if (isDerivation(*i))
throw EvalError("in `toFile': the file cannot refer to derivation outputs");
refs.insert(*i);
}
else throw EvalError("in `toFile': the file cannot contain references to derivation outputs");
}
#endif
Path storePath = addTextToStore(name, contents, refs);