Display details for the derivation source files
If the nar file is available.
This commit is contained in:
parent
7881eec315
commit
2cb5309851
3 changed files with 47 additions and 3 deletions
|
|
@ -41,6 +41,7 @@
|
||||||
select-derivation-sources-by-derivation-id
|
select-derivation-sources-by-derivation-id
|
||||||
select-derivation-references-by-derivation-id
|
select-derivation-references-by-derivation-id
|
||||||
select-derivation-source-file-by-store-path
|
select-derivation-source-file-by-store-path
|
||||||
|
select-derivation-source-file-nar-details-by-file-name
|
||||||
select-derivation-source-file-nar-data-by-file-name
|
select-derivation-source-file-nar-data-by-file-name
|
||||||
select-derivation-source-file-data-by-file-name-hash
|
select-derivation-source-file-data-by-file-name-hash
|
||||||
select-derivation-by-output-filename
|
select-derivation-by-output-filename
|
||||||
|
|
@ -831,6 +832,26 @@ WHERE substring(derivation_source_files.store_path from 12 for 32) = $1"
|
||||||
(string->number uncompressed_size)))
|
(string->number uncompressed_size)))
|
||||||
(() #f)))
|
(() #f)))
|
||||||
|
|
||||||
|
(define (select-derivation-source-file-nar-details-by-file-name conn file-name)
|
||||||
|
(match (exec-query
|
||||||
|
conn
|
||||||
|
"
|
||||||
|
SELECT compression, hash_algorithm, hash,
|
||||||
|
uncompressed_size, length(data) AS compressed_size
|
||||||
|
FROM derivation_source_file_nars
|
||||||
|
INNER JOIN derivation_source_files
|
||||||
|
ON derivation_source_file_nars.derivation_source_file_id =
|
||||||
|
derivation_source_files.id
|
||||||
|
WHERE derivation_source_files.store_path = $1"
|
||||||
|
(list file-name))
|
||||||
|
(((compression hash_algorithm hash uncompressed_size compressed_size))
|
||||||
|
`((compression . ,compression)
|
||||||
|
(hash_algorithm . ,hash_algorithm)
|
||||||
|
(hash . ,hash)
|
||||||
|
(uncompressed_size . ,(string->number uncompressed_size))
|
||||||
|
(compressed_size . ,(string->number compressed_size))))
|
||||||
|
(() #f)))
|
||||||
|
|
||||||
(define (select-derivation-source-file-nar-data-by-file-name conn file-name)
|
(define (select-derivation-source-file-nar-data-by-file-name conn file-name)
|
||||||
(match (exec-query
|
(match (exec-query
|
||||||
conn
|
conn
|
||||||
|
|
|
||||||
|
|
@ -177,7 +177,10 @@
|
||||||
#:code 404))
|
#:code 404))
|
||||||
((id)
|
((id)
|
||||||
(render-html
|
(render-html
|
||||||
#:sxml (view-derivation-source-file filename)
|
#:sxml (view-derivation-source-file
|
||||||
|
filename
|
||||||
|
(select-derivation-source-file-nar-details-by-file-name conn
|
||||||
|
filename))
|
||||||
#:extra-headers http-headers-for-unchanging-content))))
|
#:extra-headers http-headers-for-unchanging-content))))
|
||||||
(derivations
|
(derivations
|
||||||
(render-html
|
(render-html
|
||||||
|
|
|
||||||
|
|
@ -499,7 +499,14 @@
|
||||||
derivations
|
derivations
|
||||||
derivations-using-store-item-list)))))
|
derivations-using-store-item-list)))))
|
||||||
|
|
||||||
(define (view-derivation-source-file filename)
|
(define (view-derivation-source-file filename details)
|
||||||
|
(define labels
|
||||||
|
'((compression . "Compression")
|
||||||
|
(hash_algorithm . "Hash algorithm")
|
||||||
|
(hash . "Hash")
|
||||||
|
(uncompressed_size . "Uncompressed size")
|
||||||
|
(compressed_size . "Compressed size")))
|
||||||
|
|
||||||
(layout
|
(layout
|
||||||
#:body
|
#:body
|
||||||
`(,(header)
|
`(,(header)
|
||||||
|
|
@ -510,7 +517,20 @@
|
||||||
(div
|
(div
|
||||||
(@ (class "col-sm-12"))
|
(@ (class "col-sm-12"))
|
||||||
,(display-store-item-title filename)
|
,(display-store-item-title filename)
|
||||||
"Derivation source file."))))))
|
(h4 "Derivation source file")
|
||||||
|
,@(if details
|
||||||
|
`((dl
|
||||||
|
(@ (class "dl-horizontal"))
|
||||||
|
,@(append-map
|
||||||
|
(match-lambda
|
||||||
|
((key . value)
|
||||||
|
`((dt ,(assq-ref labels key))
|
||||||
|
(dd ,(if (eq? key 'hash)
|
||||||
|
`(span (@ (style "font-family: monospace"))
|
||||||
|
,value)
|
||||||
|
value)))))
|
||||||
|
details)))
|
||||||
|
'())))))))
|
||||||
|
|
||||||
(define (view-derivation derivation derivation-inputs derivation-outputs
|
(define (view-derivation derivation derivation-inputs derivation-outputs
|
||||||
builds)
|
builds)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue