about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-19T17·39+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-19T17·39+0000
commit9bd93f76069fdf25688ce984a17798ab0834202f (patch)
tree219e1859824dff9a1fe1d9e132a1fc8577c8542a /src/libexpr
parentb3d3700e113c584329473dbfbd3149c9ef8566e8 (diff)
* toFile: maintain the references.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/primops.cc14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 19d23392216c..d5708f96b754 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -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));
-        }
-        else throw EvalError("in `toFile': the file cannot contain references to derivation outputs");
+    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);
     }
-#endif    
     
     Path storePath = addTextToStore(name, contents, refs);