diff options
author | Christopher Baines <mail@cbaines.net> | 2023-02-06 15:58:09 +0100 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2023-02-06 15:58:09 +0100 |
commit | d3d9a365fc9aa09c3d6e4d5b80126976d4b39961 (patch) | |
tree | 2134e25d1eb32580ab5d9f169268c9e50d3605e8 /scripts | |
parent | 16c616010a0e7e3a000abd951f386ffe1c6d9c6c (diff) | |
download | nar-herder-d3d9a365fc9aa09c3d6e4d5b80126976d4b39961.tar nar-herder-d3d9a365fc9aa09c3d6e4d5b80126976d4b39961.tar.gz |
Don't error when removing files that don't exist
This is useful when removing in bulk and restarting the process.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/nar-herder.in | 7 |
1 files changed, 5 insertions, 2 deletions
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 |