about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-08-09T15·08+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-08-09T15·08+0000
commita18d02e0b076a8a936c3c1660d93f941a9f3183f (patch)
treec3f00cbc96f981483c8f3a2affeeb91d03001d77
parentc0bfcbdd45bfe3c45ab8bf188df926d214675a18 (diff)
* Print a warning that the subpath operator (~) is deprecated.
-rw-r--r--src/libexpr/primops.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 0dd73a016c7e..dfc565b4317e 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -197,6 +197,11 @@ static void processBinding(EvalState & state, Expr e, Derivation & drv,
     else if (matchNull(e)) ss.push_back("");
 
     else if (matchSubPath(e, e1, e2)) {
+        static bool warn = false;
+        if (!warn) {
+            printMsg(lvlError, "warning: the subpath operator (~) is deprecated, use string concatenation (+) instead");
+            warn = true;
+        }
         Strings ss2;
         processBinding(state, evalExpr(state, e1), drv, ss2);
         if (ss2.size() != 1)