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

From: Ludovic Courtès <[email-masked]>
Date: Sat, 16 May 2020 19:33:58 +0200

Hi!

zimoun <[email-masked]> skribis:

> * guix/scripts/package.scm (process-query): List installed multiple profiles.

[...]

> +       (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)

How about instead loading all the manifests, merging them with
‘concatenate-manifests’, and operating on that?  That would avoid
special-casing.

Bonus point if you can add a test case for that, similar to
‘--search-paths’ with multiple profiles.  :-)

Thanks,
Ludo’.