aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-11-05 18:49:23 +0000
committerChristopher Baines <mail@cbaines.net>2023-11-05 18:49:23 +0000
commit4f1ae74d2fb7feeaa43fecc773c417a16005d56b (patch)
treeab9d7db2520afc2871ccadbc8813c928cc85c87f
parent341eb4a2838ff1d39601f22badcb99a19acbab0c (diff)
downloaddata-service-4f1ae74d2fb7feeaa43fecc773c417a16005d56b.tar
data-service-4f1ae74d2fb7feeaa43fecc773c417a16005d56b.tar.gz
Handle derivations with no sources
-rw-r--r--guix-data-service/model/derivation.scm23
1 files changed, 12 insertions, 11 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index 4efda3a..d95e285 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -1652,17 +1652,18 @@ LIMIT $1"
(simple-format
#t "debug: insert-missing-derivations: inserting sources\n")
(for-each (lambda (derivation-id derivation)
- (let* ((sources (derivation-sources derivation))
- (sources-ids
- (insert-derivation-sources conn
- derivation-id
- sources)))
- (map (lambda (id source-file)
- (insert-derivation-source-file-nar conn
- id
- source-file))
- sources-ids
- sources)))
+ (let ((sources (derivation-sources derivation)))
+ (unless (null? sources)
+ (let ((sources-ids
+ (insert-derivation-sources conn
+ derivation-id
+ sources)))
+ (map (lambda (id source-file)
+ (insert-derivation-source-file-nar conn
+ id
+ source-file))
+ sources-ids
+ sources)))))
derivation-ids
derivations)