1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-03 22:51:47 +02:00

* Main the `substitutes-rev' table again, but now in a way that

doesn't take \Theta(n^2) space/time complexity.
This commit is contained in:
Eelco Dolstra 2004-08-31 16:13:10 +00:00
parent c25f2883b1
commit 5c443b6550
3 changed files with 40 additions and 21 deletions

View file

@ -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();
}