forked from lix-project/lix
libstore: un-inline copyNAR expansions
these are copies of copyNAR with only some variables renamed.
Change-Id: I98ddd7a98250fa5d304e18e1debf417e9f7768dd
This commit is contained in:
parent
946fc12e4e
commit
3e428f2289
|
@ -453,9 +453,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
||||||
command. (We don't trust `addToStoreFromDump` to not
|
command. (We don't trust `addToStoreFromDump` to not
|
||||||
eagerly consume the entire stream it's given, past the
|
eagerly consume the entire stream it's given, past the
|
||||||
length of the Nar. */
|
length of the Nar. */
|
||||||
TeeSource savedNARSource(from, saved);
|
copyNAR(from, saved);
|
||||||
ParseSink sink; /* null sink; just parse the NAR */
|
|
||||||
parseDump(sink, savedNARSource);
|
|
||||||
} else {
|
} else {
|
||||||
/* Incrementally parse the NAR file, stripping the
|
/* Incrementally parse the NAR file, stripping the
|
||||||
metadata, and streaming the sole file we expect into
|
metadata, and streaming the sole file we expect into
|
||||||
|
@ -907,9 +905,7 @@ static void performOp(TunnelLogger * logger, ref<Store> store,
|
||||||
if (GET_PROTOCOL_MINOR(clientVersion) >= 21)
|
if (GET_PROTOCOL_MINOR(clientVersion) >= 21)
|
||||||
source = std::make_unique<TunnelSource>(from, to);
|
source = std::make_unique<TunnelSource>(from, to);
|
||||||
else {
|
else {
|
||||||
TeeSource tee { from, saved };
|
copyNAR(from, saved);
|
||||||
ParseSink ether;
|
|
||||||
parseDump(ether, tee);
|
|
||||||
source = std::make_unique<StringSource>(saved.s);
|
source = std::make_unique<StringSource>(saved.s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,7 @@ StorePaths Store::importPaths(Source & source, CheckSigsFlag checkSigs)
|
||||||
|
|
||||||
/* Extract the NAR from the source. */
|
/* Extract the NAR from the source. */
|
||||||
StringSink saved;
|
StringSink saved;
|
||||||
TeeSource tee { source, saved };
|
copyNAR(source, saved);
|
||||||
ParseSink ether;
|
|
||||||
parseDump(ether, tee);
|
|
||||||
|
|
||||||
uint32_t magic = readInt(source);
|
uint32_t magic = readInt(source);
|
||||||
if (magic != exportMagic)
|
if (magic != exportMagic)
|
||||||
|
|
Loading…
Reference in a new issue