about summary refs log tree commit diff
path: root/src/nix-env/nix-env.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2010-04-07T15·47+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2010-04-07T15·47+0000
commitaf2a372bb000d4d5aeec37e43ee0f6245c1bba54 (patch)
tree7d92b153b255d64c1db807595c9577a43b77f50d /src/nix-env/nix-env.cc
parent9a64454faae2ab4ccedeeaad85a0e094726b4765 (diff)
* Update autoCallFunction() and findAlongAttrPath().
Diffstat (limited to 'src/nix-env/nix-env.cc')
-rw-r--r--src/nix-env/nix-env.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc
index ea85656a2b..20affa83dd 100644
--- a/src/nix-env/nix-env.cc
+++ b/src/nix-env/nix-env.cc
@@ -47,7 +47,7 @@ struct InstallSourceInfo
     Path profile; /* for srcProfile */
     string systemFilter; /* for srcNixExprDrvs */
     bool prebuiltOnly;
-    ATermMap autoArgs;
+    Bindings autoArgs;
     InstallSourceInfo() : prebuiltOnly(false) { };
 };
 
@@ -161,13 +161,11 @@ static Expr loadSourceExpr(EvalState & state, const Path & path)
 
 
 static void loadDerivations(EvalState & state, Path nixExprPath,
-    string systemFilter, const ATermMap & autoArgs,
+    string systemFilter, const Bindings & autoArgs,
     const string & pathPrefix, DrvInfos & elems)
 {
     Value v;
-    state.eval(loadSourceExpr(state, nixExprPath), v);
-
-    // !!! findAlongAttrPath(state, pathPrefix, autoArgs, loadSourceExpr(state, nixExprPath))
+    findAlongAttrPath(state, pathPrefix, autoArgs, loadSourceExpr(state, nixExprPath), v);
     
     getDerivations(state, v, pathPrefix, autoArgs, elems);
 
@@ -579,14 +577,12 @@ static void queryInstSources(EvalState & state,
         }
 
         case srcAttrPath: {
-            throw Error("not implemented");
-#if 0            
-            foreach (Strings::const_iterator, i, args)
-                getDerivations(state,
-                    findAlongAttrPath(state, *i, instSource.autoArgs,
-                        loadSourceExpr(state, instSource.nixExprPath)),
-                    "", instSource.autoArgs, elems);
-#endif
+            foreach (Strings::const_iterator, i, args) {
+                Value v;
+                findAlongAttrPath(state, *i, instSource.autoArgs,
+                    loadSourceExpr(state, instSource.nixExprPath), v);
+                getDerivations(state, v, "", instSource.autoArgs, elems);
+            }
             break;
         }
     }