about summary refs log tree commit diff
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2014-10-18T02·15-0400
committerShea Levy <shea@shealevy.com>2014-10-18T02·15-0400
commitd16e3c7f091b0ecc4975368575c71d69ce7a9bc7 (patch)
tree6479b3ea1c8da51e9b26b1a7b05d1291b589ec56
parentbca6d3563653c384fab2da105a4c27dfe508c8cd (diff)
Export realiseContext in libnixexpr
Useful for importNative plugins
-rw-r--r--src/libexpr/eval.hh8
-rw-r--r--src/libexpr/primops.cc12
2 files changed, 11 insertions, 9 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 38d73772560f..daf53846ffd5 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -336,5 +336,13 @@ string showType(const Value & v);
 /* If `path' refers to a directory, then append "/default.nix". */
 Path resolveExprPath(Path path);
 
+struct InvalidPathError : EvalError
+{
+    Path path;
+    InvalidPathError(const Path & path);
+};
+
+/* Realise all paths in `context' */
+void realiseContext(const PathSet & context);
 
 }
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index a1374a05e12d..50d03f369bf9 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -39,16 +39,10 @@ std::pair<string, string> decodeContext(const string & s)
 }
 
 
-struct InvalidPathError : EvalError
-{
-    Path path;
-    InvalidPathError(const Path & path) :
-        EvalError(format("path ‘%1%’ is not valid") % path), path(path) {};
-    ~InvalidPathError() throw () { };
-};
-
+InvalidPathError::InvalidPathError(const Path & path) :
+    EvalError(format("path ‘%1%’ is not valid") % path), path(path) {}
 
-static void realiseContext(const PathSet & context)
+void realiseContext(const PathSet & context)
 {
     PathSet drvs;
     for (auto & i : context) {