aboutsummaryrefslogtreecommitdiff
path: root/guix-data-service
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2019-09-01 13:04:23 +0100
committerChristopher Baines <mail@cbaines.net>2019-09-01 17:40:16 +0100
commitc1fad22cd1767b8f64c66a1bd2f47ecf387a992a (patch)
tree0716f55c09cd7d460a4459e9a90f238b405df22c /guix-data-service
parent3ad100bedcda965de9bc708f6a48310d35d12b8d (diff)
downloaddata-service-c1fad22cd1767b8f64c66a1bd2f47ecf387a992a.tar
data-service-c1fad22cd1767b8f64c66a1bd2f47ecf387a992a.tar.gz
Handle a change in guix with the <derivation-input> record
The first field is now a <derivation> record, rather than a store path for the derivation. It's probably not necessary to cope with two versions, but this is what I've done currently.
Diffstat (limited to 'guix-data-service')
-rw-r--r--guix-data-service/model/derivation.scm20
1 files changed, 14 insertions, 6 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm
index df44814..6b94384 100644
--- a/guix-data-service/model/derivation.scm
+++ b/guix-data-service/model/derivation.scm
@@ -277,12 +277,20 @@ ORDER BY derivations.system DESC,
(insert-into-derivation-inputs
(append-map
(match-lambda
- (($ <derivation-input> path sub-derivations)
- (map (lambda (sub-derivation)
- (select-derivation-output-id conn
- sub-derivation
- path))
- sub-derivations)))
+ (($ <derivation-input> derivation-or-path sub-derivations)
+ (let ((path
+ (match derivation-or-path
+ ((? derivation? d)
+ ;; The first field changed to a derivation (from the file
+ ;; name) in 5cf4b26d52bcea382d98fb4becce89be9ee37b55
+ (derivation-file-name d))
+ ((? string? s)
+ s))))
+ (map (lambda (sub-derivation)
+ (select-derivation-output-id conn
+ sub-derivation
+ path))
+ sub-derivations))))
derivation-inputs)))))
(define (select-from-derivation-source-files store-paths)