about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2011-09-16T11·31+0000
committerShea Levy <shea@shealevy.com>2011-09-16T11·31+0000
commite81c09edbf6b352ec96668be35a68037df2f6342 (patch)
tree47c4617b373bd139b8466b0553734c735c42b711 /src
parentbf50d6ad3271aaa6ac93b68e99f5acb1d9a158c7 (diff)
Remove the current output metadata from the string for unsaveDiscardOutputDependency
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/primops.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index a752b9a5963e..d5e1ce7be918 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -974,7 +974,14 @@ static void prim_unsafeDiscardOutputDependency(EvalState & state, Value * * args
     PathSet context2;
     foreach (PathSet::iterator, i, context) {
         Path p = *i;
-        if (p.at(0) == '=') p = "~" + string(p, 1);
+        if (p.at(0) == '=')
+        {
+            size_t index;
+            p = "~" + string(p, 1);
+            index = p.find("=");
+            if (index < p.find("/"))
+                p = "~" + string(p, index + 1);
+        }
         context2.insert(p);
     }