aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-02-06 22:26:42 +0100
committerChristopher Baines <mail@cbaines.net>2023-02-06 22:35:55 +0100
commit4d549499dc5d70944d3c350de5ea424f7a357ff2 (patch)
tree0124a70c39f677af0bb621c2dd20e83e56e4cc77 /scripts
parent24ece550f538fa71927eddc6595bc81acfa60225 (diff)
downloadnar-herder-4d549499dc5d70944d3c350de5ea424f7a357ff2.tar
nar-herder-4d549499dc5d70944d3c350de5ea424f7a357ff2.tar.gz
Refactor, pulling the narinfo out in to a variable
Diffstat (limited to 'scripts')
-rw-r--r--scripts/nar-herder.in27
1 files changed, 15 insertions, 12 deletions
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