From d3d9a365fc9aa09c3d6e4d5b80126976d4b39961 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 6 Feb 2023 15:58:09 +0100 Subject: Don't error when removing files that don't exist This is useful when removing in bulk and restarting the process. --- scripts/nar-herder.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 1493d0b..1c1d4d0 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -359,11 +359,14 @@ database (assq-ref opts 'storage) metrics-registry - (store-path-hash-part store-path))) + (store-path-hash-part store-path) + #:error-unless-files-to-remove? #f)) (log-msg 'WARN "no --storage set, so just removing from the database")) - (database-remove-narinfo database store-path)) + (let ((removed? (database-remove-narinfo database store-path))) + (unless removed? + (log-msg 'WARN store-path " not found to remove")))) (assq-ref opts 'arguments)))) (("check" rest ...) (let* ((opts (parse-options (append %base-options -- cgit v1.2.3