ci: Backport package-channels procedure.

* gnu/ci.scm (package-channels): New procedure.
This commit is contained in:
Mathieu Othacehe 2021-06-14 10:08:49 +02:00
parent 7546a1d3c0
commit c13ad2b889
No known key found for this signature in database
GPG key ID: 8354763531769CA6

View file

@ -109,6 +109,27 @@ does not have the expected structure."
(_ #f)))
;; Backport from (guix describe) module.
(define (package-channels package)
"Return the list of channels providing PACKAGE or an empty list if it could
not be determined."
(match (and=> (package-location package) location-file)
(#f '())
(file
(let ((file (if (string-prefix? "/" file)
file
(search-path %load-path file))))
(if (and file
(string-prefix? (%store-prefix) file))
(filter-map
(lambda (entry)
(let ((item (manifest-entry-item entry)))
(and (or (string-prefix? item file)
(string=? "guix" (manifest-entry-name entry)))
(manifest-entry-channel entry))))
(current-profile-entries))
'())))))
(define* (derivation->job name drv
#:key
(max-silent-time 3600)