about summary refs log tree commit diff
path: root/src/nix-store/main.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/main.cc')
-rw-r--r--src/nix-store/main.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc
index dc7a6de8b8ec..51e587255003 100644
--- a/src/nix-store/main.cc
+++ b/src/nix-store/main.cc
@@ -177,19 +177,27 @@ static void opSubstitute(Strings opFlags, Strings opArgs)
     while (1) {
         Path srcPath;
         Substitute sub;
+        PathSet references;
         getline(cin, srcPath);
         if (cin.eof()) break;
         getline(cin, sub.program);
         string s;
-        getline(cin, s);
         int n;
+        getline(cin, s);
         if (!string2Int(s, n)) throw Error("number expected");
         while (n--) {
             getline(cin, s);
             sub.args.push_back(s);
         }
+        getline(cin, s);
+        if (!string2Int(s, n)) throw Error("number expected");
+        while (n--) {
+            getline(cin, s);
+            references.insert(s);
+        }
         if (!cin || cin.eof()) throw Error("missing input");
         subPairs.push_back(pair<Path, Substitute>(srcPath, sub));
+        setReferences(txn, srcPath, references);
     }
 
     registerSubstitutes(txn, subPairs);