mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
Use a RewritingSink in derivation goal
Possibly this will make it stream
This commit is contained in:
parent
3ebe1341ab
commit
a917fb0d53
1 changed files with 9 additions and 6 deletions
|
@ -2384,13 +2384,16 @@ SingleDrvOutputs LocalDerivationGoal::registerOutputs()
|
||||||
if (!outputRewrites.empty()) {
|
if (!outputRewrites.empty()) {
|
||||||
debug("rewriting hashes in '%1%'; cross fingers", actualPath);
|
debug("rewriting hashes in '%1%'; cross fingers", actualPath);
|
||||||
|
|
||||||
/* FIXME: this is in-memory. */
|
/* FIXME: Is this actually streaming? */
|
||||||
StringSink sink;
|
auto source = sinkToSource([&](Sink & nextSink) {
|
||||||
dumpPath(actualPath, sink);
|
RewritingSink rsink(outputRewrites, nextSink);
|
||||||
|
dumpPath(actualPath, rsink);
|
||||||
|
rsink.flush();
|
||||||
|
});
|
||||||
|
Path tmpPath = actualPath + ".tmp";
|
||||||
|
restorePath(tmpPath, *source);
|
||||||
deletePath(actualPath);
|
deletePath(actualPath);
|
||||||
sink.s = rewriteStrings(sink.s, outputRewrites);
|
movePath(tmpPath, actualPath);
|
||||||
StringSource source(sink.s);
|
|
||||||
restorePath(actualPath, source);
|
|
||||||
|
|
||||||
/* FIXME: set proper permissions in restorePath() so
|
/* FIXME: set proper permissions in restorePath() so
|
||||||
we don't have to do another traversal. */
|
we don't have to do another traversal. */
|
||||||
|
|
Loading…
Reference in a new issue