aboutsummaryrefslogtreecommitdiff
path: root/src/nix-store
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-08-31 16:13:10 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-08-31 16:13:10 +0000
commit5c443b65501903f636b00b908bb8eb10e022402e (patch)
tree6eda7c08e475b9a4024e167b18531726d3177299 /src/nix-store
parentc25f2883b149bf71931f963d29241fe012360633 (diff)
* Main the `substitutes-rev' table again, but now in a way that
doesn't take \Theta(n^2) space/time complexity.
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 e9948c7cf..a8acd30c7 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();
}