1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-11 04:56:01 +01:00

Path fetcher: Only show "copying to store" when actually copying

This commit is contained in:
Eelco Dolstra 2025-06-27 17:59:15 +02:00
parent 7bb167d58f
commit 51acb1d4bc

View file

@ -127,8 +127,6 @@ struct PathInputScheme : InputScheme
auto absPath = getAbsPath(input); auto absPath = getAbsPath(input);
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying %s to the store", absPath));
// FIXME: check whether access to 'path' is allowed. // FIXME: check whether access to 'path' is allowed.
auto storePath = store->maybeParseStorePath(absPath.string()); auto storePath = store->maybeParseStorePath(absPath.string());
@ -137,6 +135,7 @@ struct PathInputScheme : InputScheme
time_t mtime = 0; time_t mtime = 0;
if (!storePath || storePath->name() != "source" || !store->isValidPath(*storePath)) { if (!storePath || storePath->name() != "source" || !store->isValidPath(*storePath)) {
Activity act(*logger, lvlTalkative, actUnknown, fmt("copying %s to the store", absPath));
// FIXME: try to substitute storePath. // FIXME: try to substitute storePath.
auto src = sinkToSource([&](Sink & sink) { auto src = sinkToSource([&](Sink & sink) {
mtime = dumpPathAndGetMtime(absPath.string(), sink, defaultPathFilter); mtime = dumpPathAndGetMtime(absPath.string(), sink, defaultPathFilter);