diff options
-rw-r--r-- | scripts/nar-herder.in | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 9e70b77..c8726b8 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -51,6 +51,7 @@ (fibers conditions) (fibers web server) ((guix ui) #:select (read/eval string->duration)) + (guix store) (guix progress) (guix narinfo) (guix derivations) @@ -321,16 +322,23 @@ "https://narherderdummyvalue"))))) (when (assq-ref opts 'ensure-references-exist) - (for-each - (lambda (reference) - (unless (database-select-narinfo-by-hash - database - (string-take reference 32)) - (error - (simple-format (current-error-port) - "missing reference to ~A\n" - reference)))) - (narinfo-references narinfo))) + (let ((self-reference + (store-path-base + (narinfo-path narinfo)))) + (for-each + (lambda (reference) + (when (and + (not + (string=? reference self-reference)) + (not + (database-select-narinfo-by-hash + database + (string-take reference 32)))) + (error + (simple-format (current-error-port) + "missing reference to ~A\n" + reference)))) + (narinfo-references narinfo)))) (database-insert-narinfo database |