about summary refs log tree commit diff
path: root/src/libexpr/get-drvs.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17T14·13+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-17T14·13+0000
commitdaa8f85fcd3d5d7c48a51305818e05bee866b936 (patch)
treee4d9e0837e30b27be5f568cfeb53ac3cbb92043f /src/libexpr/get-drvs.cc
parent24737f279e6f1e0fd079609b9397deb867925324 (diff)
* Backwards compatibility hack for user environments made by Nix <= 0.10.
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r--src/libexpr/get-drvs.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc
index acdc0c7b585a..3c7061fcd33a 100644
--- a/src/libexpr/get-drvs.cc
+++ b/src/libexpr/get-drvs.cc
@@ -10,6 +10,13 @@ string DrvInfo::queryDrvPath(EvalState & state) const
 {
     if (drvPath == "") {
         Expr a = attrs->get(toATerm("drvPath"));
+
+        /* Backwards compatibility hack with user environments made by
+           Nix <= 0.10: these contain illegal Path("") expressions. */
+        ATerm t;
+        if (a && matchPath(evalExpr(state, a), t))
+            return aterm2String(t);
+        
         PathSet context;
         (string &) drvPath = a ? coerceToPath(state, a, context) : "";
     }