about summary refs log tree commit diff
path: root/src/nix-store
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store')
-rw-r--r--src/nix-store/main.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc
index e9948c7cf8ac..a8acd30c77b7 100644
--- a/src/nix-store/main.cc
+++ b/src/nix-store/main.cc
@@ -158,6 +158,7 @@ static void opSubstitute(Strings opFlags, Strings opArgs)
     if (!opArgs.empty())
         throw UsageError("no arguments expected");
 
+    SubstitutePairs subPairs;
     Transaction txn;
     createStoreTransaction(txn);
 
@@ -179,9 +180,11 @@ static void opSubstitute(Strings opFlags, Strings opArgs)
             sub.args.push_back(s);
         }
         if (!cin || cin.eof()) throw Error("missing input");
-        registerSubstitute(txn, srcPath, sub);
+        subPairs.push_back(pair<Path, Substitute>(srcPath, sub));
     }
 
+    registerSubstitutes(txn, subPairs);
+    
     txn.commit();
 }