From 4d549499dc5d70944d3c350de5ea424f7a357ff2 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 6 Feb 2023 22:26:42 +0100 Subject: Refactor, pulling the narinfo out in to a variable --- scripts/nar-herder.in | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'scripts') diff --git a/scripts/nar-herder.in b/scripts/nar-herder.in index 1c1d4d0..2f4d6d1 100644 --- a/scripts/nar-herder.in +++ b/scripts/nar-herder.in @@ -308,18 +308,21 @@ (call-with-progress-reporter progress (lambda (report) - (for-each (lambda (narinfo) - (database-insert-narinfo - database - (call-with-input-file narinfo - (lambda (port) - ;; Set url to a dummy value as this doesn't - ;; matter - (read-narinfo port "https://narherderdummyvalue"))) - #:tags (or (assq-ref opts 'tags) - '())) - - (report)) + (for-each (lambda (narinfo-file) + (let ((narinfo + (call-with-input-file narinfo-file + (lambda (port) + ;; Set url to a dummy value as this doesn't + ;; matter + (read-narinfo port + "https://narherderdummyvalue"))))) + (database-insert-narinfo + database + narinfo + #:tags (or (assq-ref opts 'tags) + '())) + + (report))) narinfos)))))) (("remove" rest ...) (let* ((opts (parse-options %base-options -- cgit v1.2.3