From c13ad2b889f54350d78ce993b79f1bea0043c3d8 Mon Sep 17 00:00:00 2001 From: Mathieu Othacehe Date: Mon, 14 Jun 2021 10:08:49 +0200 Subject: ci: Backport package-channels procedure. * gnu/ci.scm (package-channels): New procedure. --- gnu/ci.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/ci.scm b/gnu/ci.scm index 5a068167ae..f452da95f5 100644 --- a/gnu/ci.scm +++ b/gnu/ci.scm @@ -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) -- cgit 1.4.1