From 7f02d1788192e7a830af0b78380255d64169e495 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 20 Feb 2024 10:28:44 +0100 Subject: [PATCH] Don't say "copying X to the store" in read-only mode (cherry picked from commit 6162105675762a394603dbbf39cb1fa55065fec3) --- src/libfetchers/fetch-to-store.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/libfetchers/fetch-to-store.cc b/src/libfetchers/fetch-to-store.cc index 196489e05..547752fe8 100644 --- a/src/libfetchers/fetch-to-store.cc +++ b/src/libfetchers/fetch-to-store.cc @@ -47,12 +47,15 @@ StorePath fetchToStore( } else debug("source path '%s' is uncacheable", path); - Activity act(*logger, lvlChatty, actUnknown, fmt("copying '%s' to the store", path)); + auto readOnly = settings.readOnlyMode; + + Activity act(*logger, lvlChatty, actUnknown, + fmt(readOnly ? "hashing '%s'" : "copying '%s' to the store", path)); auto filter2 = filter ? *filter : defaultPathFilter; auto storePath = - settings.readOnlyMode + readOnly ? store.computeStorePath( name, *path.accessor, path.path, method, HashAlgorithm::SHA256, {}, filter2).first : store.addToStore(