all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Liliana Marie Prikler <liliana.prikler@gmail.com>
To: 58972@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
	"Leo Famulari" <leo@famulari.name>,
	"Maxime Devos" <maximedevos@telenet.be>,
	zimoun <zimon.toutoune@gmail.com>
Subject: [bug#58972] [PATCH 1/3] guix: ui: Handle single outputs.
Date: Wed, 2 Nov 2022 21:01:30 +0100	[thread overview]
Message-ID: <27e3e24474785ec4cf75607b4cdec9631a081bcd.camel@gmail.com> (raw)
In-Reply-To: <d2fff1ed446477d257e1c3fab8da6270af8d029f.camel@gmail.com>

The current code says "out" contains "everything else", even if there's no
other output to contain anything.

* guix/ui.scm (package->recutils)[default-output-synopses]: New variable.
[output->recutils]: Take default synopses as argument.
["outputs"]: Distinguish single and multiple outputs.
---
 guix/ui.scm | 29 ++++++++++++++++++++---------
 1 file changed, 20 insertions(+), 9 deletions(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index dad2b853ac..60b09bf6e4 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -1512,7 +1512,15 @@ (define (dependencies->recutils packages)
                                    (sort packages package<?))) " ")))
       (split-lines list (string-length "dependencies: "))))
 
-  (define (output->recutils package output)
+  (define %default-output-synopses
+    `(("bin" . ,(G_ "executable programs and scripts"))
+      ("debug" . ,(G_ "debug information"))
+      ("lib" . ,(G_ "shared libraries"))
+      ("static" . ,(G_ "static libraries"))
+      ("out" . ,(G_ "everything else"))))
+
+  (define* (output->recutils package output #:optional
+                             (default-synopses %default-output-synopses))
     (string-append
      "+ " output ": "
      (or
@@ -1522,12 +1530,7 @@ (define (output->recutils package output)
           (and (string=? key output) (P_ synopsis)))
          (_ #f))
        (package-properties package))
-      (assoc-ref `(("bin" . ,(G_ "executable programs and scripts"))
-                   ("debug" . ,(G_ "debug information"))
-                   ("lib" . ,(G_ "shared libraries"))
-                   ("static" . ,(G_ "static libraries"))
-                   ("out" . ,(G_ "everything else")))
-                 output)
+      (assoc-ref default-synopses output)
       (G_ "see Appendix H"))))
 
   (define (package-outputs/out-last package)
@@ -1546,8 +1549,16 @@ (define highlighting*
   ;; Note: Don't i18n field names so that people can post-process it.
   (format port "name: ~a~%" (highlight (package-name p) port*))
   (format port "version: ~a~%" (highlight (package-version p) port*))
-  (format port "outputs:~%~{~a~%~}"
-          (map (cut output->recutils p <>) (package-outputs/out-last p)))
+  (match (package-outputs/out-last p)
+    (("out")                            ; one output has everything
+     (format port "outputs:~%~a~%"
+             (output->recutils p "out"
+                               (cons `("out" . ,(G_ "everything"))
+                                     %default-output-synopses))))
+    (outputs                            ; multiple outputs
+     (format port "outputs:~%~{~a~%~}"
+             (map (cut output->recutils p <>) (package-outputs/out-last p)))))
+
   (format port "systems: ~a~%"
           (split-lines (string-join (package-transitive-supported-systems p))
                        (string-length "systems: ")))
-- 
2.38.0





  parent reply	other threads:[~2022-11-02 20:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 20:19 [bug#58972] [PATCH 0/3] Improve output descriptions Liliana Marie Prikler
2022-11-02 20:01 ` [bug#58972] [PATCH v2 1/3] guix: ui: Handle single outputs Liliana Marie Prikler
2022-11-04 10:07   ` Ludovic Courtès
2022-11-02 20:01 ` Liliana Marie Prikler [this message]
2022-11-03  9:01   ` [bug#58972] [PATCH " zimoun
2022-11-03 19:19     ` Liliana Marie Prikler
2022-11-02 20:10 ` [bug#58972] [PATCH 2/3] guix: ui: Use a shrug emoji when missing output descriptions Liliana Marie Prikler
2022-11-02 20:51   ` ( via Guix-patches via
2022-11-02 21:25     ` ( via Guix-patches via
2022-11-03  9:10   ` zimoun
2022-11-03 15:05   ` Ludovic Courtès
2022-11-02 20:10 ` [bug#58972] [PATCH v2 2/3] guix: ui: Improve " Liliana Marie Prikler
2022-11-04  9:55   ` Ludovic Courtès
2022-11-02 20:16 ` [bug#58972] [PATCH v2 3/3] guix: ui: Add default synopsis for “doc” output Liliana Marie Prikler
2022-11-04  8:43   ` zimoun
2022-11-02 20:16 ` [bug#58972] [PATCH " Liliana Marie Prikler
2022-11-03  9:10   ` zimoun
2022-11-03 15:06     ` Ludovic Courtès
2022-11-05  9:35       ` bug#58972: " Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=27e3e24474785ec4cf75607b4cdec9631a081bcd.camel@gmail.com \
    --to=liliana.prikler@gmail.com \
    --cc=58972@debbugs.gnu.org \
    --cc=leo@famulari.name \
    --cc=ludo@gnu.org \
    --cc=maximedevos@telenet.be \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.