From daa8f85fcd3d5d7c48a51305818e05bee866b936 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 17 Oct 2006 14:13:15 +0000 Subject: [PATCH] * Backwards compatibility hack for user environments made by Nix <= 0.10. --- src/libexpr/get-drvs.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index acdc0c7b58..3c7061fcd3 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) : ""; }