From 958e81987b5b86fba06090078a556f51037aa23c Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Mon, 11 May 2020 13:02:16 -0600 Subject: switch from printError warnings to logWarnings --- src/libstore/build.cc | 14 +++++++++++--- src/libstore/store-api.cc | 6 +++++- 2 files changed, 16 insertions(+), 4 deletions(-) (limited to 'src/libstore') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index f8cc1ce36..a7d6e53b0 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -3647,7 +3647,11 @@ void DerivationGoal::registerOutputs() /* Apply hash rewriting if necessary. */ bool rewritten = false; if (!outputRewrites.empty()) { - printError("warning: rewriting hashes in '%1%'; cross fingers", path); + logWarning( + ErrorInfo { + .name = "Rewriting hashes", + .hint = hintfmt("rewriting hashes in '%1%'; cross fingers", path) + }); /* Canonicalise first. This ensures that the path we're rewriting doesn't contain a hard link to /etc/shadow or @@ -4414,8 +4418,12 @@ void SubstitutionGoal::tryNext() && !sub->isTrusted && !info->checkSignatures(worker.store, worker.store.getPublicKeys())) { - printError("warning: substituter '%s' does not have a valid signature for path '%s'", - sub->getUri(), worker.store.printStorePath(storePath)); + logWarning( + ErrorInfo { + .name = "Invalid path signature", + .hint = hintfmt("substituter '%s' does not have a valid signature for path '%s'", + sub->getUri(), worker.store.printStorePath(storePath)) + }); tryNext(); return; } diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 542e5c552..d1281d130 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -769,7 +769,11 @@ void ValidPathInfo::sign(const Store & store, const SecretKey & secretKey) bool ValidPathInfo::isContentAddressed(const Store & store) const { auto warn = [&]() { - printError("warning: path '%s' claims to be content-addressed but isn't", store.printStorePath(path)); + logWarning( + ErrorInfo{ + .name = "Path not content-addressed", + .hint = hintfmt("path '%s' claims to be content-addressed but isn't", store.printStorePath(path)) + }); }; if (hasPrefix(ca, "text:")) { -- cgit v1.2.3