unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54454] [PATCH] ui: Describe package outputs.
@ 2022-03-18 19:16 Liliana Marie Prikler
  2022-03-18 20:12 ` Maxime Devos
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Liliana Marie Prikler @ 2022-03-18 19:16 UTC (permalink / raw)
  To: 54454

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2496 bytes --]

* guix/ui.scm (package->recutils): Output outputs with their descriptions,
one per line.
---
Salut Guix,

People have been complaining for a while, that outputs are not really
discoverable [who?].  This patch attempts to fix that by displaying each
on their own line with a (hopefully) helpful description next to it.
It is expected, that these descriptions do not span multiple lines.

Cheers

 guix/ui.scm | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/guix/ui.scm b/guix/ui.scm
index 6c194eb3c9..dfa90126bc 100644
--- a/guix/ui.scm
+++ b/guix/ui.scm
@@ -17,6 +17,7 @@
 ;;; Copyright © 2020 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2018 Steve Sprang <scs@stevesprang.com>
+;;; Copyright © 2022 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1543,13 +1544,33 @@ (define (dependencies->recutils packages)
                                    (sort packages package<?))) " ")))
       (split-lines list (string-length "dependencies: "))))
 
+  (define (output->recutils package output)
+    (let ((descs (assq-ref (package-properties package) 'output-descriptions)))
+      (string-append
+       "+ " output ": "
+       (or
+        (assoc-ref descs output)
+        (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)
+        (G_ "state secrets.")))))
+
+  (define (package-outputs/out-last package)
+    ((compose append partition)
+     (negate (cut string=? "out" <>))
+     (package-outputs package)))
+
   (define (package<? p1 p2)
     (string<? (package-full-name p1) (package-full-name p2)))
 
   ;; Note: Don't i18n field names so that people can post-process it.
   (format port "name: ~a~%" (package-name p))
   (format port "version: ~a~%" (package-version p))
-  (format port "outputs: ~a~%" (string-join (package-outputs p)))
+  (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.34.0





^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-09-05  7:27 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-18 19:16 [bug#54454] [PATCH] ui: Describe package outputs Liliana Marie Prikler
2022-03-18 20:12 ` Maxime Devos
2022-03-18 20:23   ` Liliana Marie Prikler
2022-03-18 20:16 ` Maxime Devos
2022-03-18 20:25   ` Liliana Marie Prikler
2022-03-18 20:50     ` Maxime Devos
2022-03-18 20:54 ` Maxime Devos
2022-03-18 22:24   ` Liliana Marie Prikler
2022-03-18 22:57     ` Maxime Devos
2022-03-18 23:27       ` Liliana Marie Prikler
2022-03-19  8:56         ` Maxime Devos
2022-03-19 10:48           ` Ludovic Courtès
2022-03-19 16:24 ` Leo Famulari
2022-06-26 12:37 ` [bug#54454] [PATCH v2] " Liliana Marie Prikler
2022-08-16 19:37   ` bug#54454: " Liliana Marie Prikler
2022-09-02 17:07     ` [bug#54454] " Ludovic Courtès
2022-09-02 17:14       ` Liliana Marie Prikler
2022-09-03  9:53         ` zimoun
2022-09-05  7:25           ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).