guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch version-1.2.0 updated: ci: Backport package-channels procedure.


From: guix-commits
Subject: branch version-1.2.0 updated: ci: Backport package-channels procedure.
Date: Mon, 14 Jun 2021 04:09:25 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch version-1.2.0
in repository guix.

The following commit(s) were added to refs/heads/version-1.2.0 by this push:
     new c13ad2b  ci: Backport package-channels procedure.
c13ad2b is described below

commit c13ad2b889f54350d78ce993b79f1bea0043c3d8
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Mon Jun 14 10:08:49 2021 +0200

    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 5a06816..f452da9 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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]