mirror of
https://github.com/NixOS/nix.git
synced 2024-11-22 06:42:28 +00:00
Show when we're unpacking an archive into the Git cache
This happens in parallel with the download (which starts later), so
you only see this message when the download has finished but the
import hasn't.
(cherry picked from commit 01839b525c
)
This commit is contained in:
parent
331bcdb831
commit
8a80f8a6ac
@ -248,10 +248,15 @@ struct GitArchiveInputScheme : InputScheme
|
|||||||
getFileTransfer()->download(std::move(req), sink);
|
getFileTransfer()->download(std::move(req), sink);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
auto act = std::make_unique<Activity>(*logger, lvlInfo, actUnknown,
|
||||||
|
fmt("unpacking '%s' into the Git cache", input.to_string()));
|
||||||
|
|
||||||
TarArchive archive { *source };
|
TarArchive archive { *source };
|
||||||
auto parseSink = getTarballCache()->getFileSystemObjectSink();
|
auto parseSink = getTarballCache()->getFileSystemObjectSink();
|
||||||
auto lastModified = unpackTarfileToSink(archive, *parseSink);
|
auto lastModified = unpackTarfileToSink(archive, *parseSink);
|
||||||
|
|
||||||
|
act.reset();
|
||||||
|
|
||||||
TarballInfo tarballInfo {
|
TarballInfo tarballInfo {
|
||||||
.treeHash = parseSink->sync(),
|
.treeHash = parseSink->sync(),
|
||||||
.lastModified = lastModified
|
.lastModified = lastModified
|
||||||
|
@ -155,6 +155,9 @@ DownloadTarballResult downloadTarball(
|
|||||||
|
|
||||||
// TODO: fall back to cached value if download fails.
|
// TODO: fall back to cached value if download fails.
|
||||||
|
|
||||||
|
auto act = std::make_unique<Activity>(*logger, lvlInfo, actUnknown,
|
||||||
|
fmt("unpacking '%s' into the Git cache", url));
|
||||||
|
|
||||||
AutoDelete cleanupTemp;
|
AutoDelete cleanupTemp;
|
||||||
|
|
||||||
/* Note: if the download is cached, `importTarball()` will receive
|
/* Note: if the download is cached, `importTarball()` will receive
|
||||||
@ -179,6 +182,8 @@ DownloadTarballResult downloadTarball(
|
|||||||
auto parseSink = getTarballCache()->getFileSystemObjectSink();
|
auto parseSink = getTarballCache()->getFileSystemObjectSink();
|
||||||
auto lastModified = unpackTarfileToSink(archive, *parseSink);
|
auto lastModified = unpackTarfileToSink(archive, *parseSink);
|
||||||
|
|
||||||
|
act.reset();
|
||||||
|
|
||||||
auto res(_res->lock());
|
auto res(_res->lock());
|
||||||
|
|
||||||
Attrs infoAttrs;
|
Attrs infoAttrs;
|
||||||
|
Loading…
Reference in New Issue
Block a user