diff options
author | Christopher Baines <mail@cbaines.net> | 2019-12-16 20:29:28 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-12-16 20:29:28 +0000 |
commit | 4af643136e121c8158bc41caa5acfbf10d4d35bb (patch) | |
tree | 66e010d69c9e3ff09b2a3543c1ae0870d6c80c56 /guix-data-service/model | |
parent | e1d1d372ca648c63650ea4119a565fa3d7bcd73e (diff) | |
download | data-service-4af643136e121c8158bc41caa5acfbf10d4d35bb.tar data-service-4af643136e121c8158bc41caa5acfbf10d4d35bb.tar.gz |
Allow filtering by system and target on the derivation-outputs page
So that this can match up with the package reproducibility page.
Diffstat (limited to 'guix-data-service/model')
-rw-r--r-- | guix-data-service/model/derivation.scm | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/guix-data-service/model/derivation.scm b/guix-data-service/model/derivation.scm index c565607..5d900fc 100644 --- a/guix-data-service/model/derivation.scm +++ b/guix-data-service/model/derivation.scm @@ -273,6 +273,8 @@ ORDER BY derivations.file_name commit-hash #:key reproducibility-status + system + target limit-results after-path) (define query @@ -315,9 +317,22 @@ INNER JOIN packages ON package_derivations.package_id = packages.id WHERE guix_revisions.commit = $1 " - (if after-path - " AND derivation_output_details.path > $2" - "") + (let ((criteria + `(,@(if after-path + '(" AND derivation_output_details.path > ") + '()) + ,@(if system + '(" AND package_derivations.system = ") + '()) + ,@(if target + '(" AND package_derivations.target = ") + '())))) + (string-concatenate + (map (lambda (query count) + (simple-format #f "~A$~A" + query count)) + criteria + (iota (length criteria) 2)))) (cond ((string=? reproducibility-status "any") "") @@ -377,6 +392,12 @@ ORDER BY derivation_output_details.path `(,commit-hash ,@(if after-path (list after-path) + '()) + ,@(if system + (list system) + '()) + ,@(if target + (list target) '()))))) (define (insert-derivation-outputs conn |