Subject: [bug#41260] [PATCH 1/1] guix package: Support multiple profiles with '--list-installed'.

From: zimoun <[email-masked]>
Date: Thu, 14 May 2020 16:17:59 +0200

* guix/scripts/package.scm (process-query): List installed multiple profiles.
---
 guix/scripts/package.scm | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index a69efa365e..a4a6100a33 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -717,20 +717,23 @@ processed, #f otherwise."
        #t)
 
       (('list-installed regexp)
-       (let* ((regexp    (and regexp (make-regexp* regexp regexp/icase)))
-              (manifest  (profile-manifest profile))
-              (installed (manifest-entries manifest)))
-         (leave-on-EPIPE
-          (for-each (match-lambda
-                      (($ <manifest-entry> name version output path _)
-                       (when (or (not regexp)
-                                 (regexp-exec regexp name))
-                         (format #t "~a\t~a\t~a\t~a~%"
-                                 name (or version "?") output path))))
-
-                    ;; Show most recently installed packages last.
-                    (reverse installed)))
-         #t))
+       (for-each
+        (lambda (profile)
+          (let* ((regexp    (and regexp (make-regexp* regexp regexp/icase)))
+                 (manifest  (profile-manifest profile))
+                 (installed (manifest-entries manifest)))
+            (leave-on-EPIPE
+             (for-each (match-lambda
+                         (($ <manifest-entry> name version output path _)
+                          (when (or (not regexp)
+                                    (regexp-exec regexp name))
+                            (format #t "~a\t~a\t~a\t~a~%"
+                                    name (or version "?") output path))))
+
+                       ;; Show most recently installed packages last.
+                       (reverse installed)))))
+        profiles)
+       #t)
 
       (('list-available regexp)
        (let* ((regexp    (and regexp (make-regexp* regexp regexp/icase)))
-- 
2.26.1