From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id WK6WF6TSYmPf9gAAbAwnHQ (envelope-from ) for ; Wed, 02 Nov 2022 21:27:16 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 0C3DFqTSYmPgDQAAG6o9tA (envelope-from ) for ; Wed, 02 Nov 2022 21:27:16 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1BCCC1B314 for ; Wed, 2 Nov 2022 21:27:15 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqKKG-00032C-Nr; Wed, 02 Nov 2022 16:27:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oqKKE-00031T-Kt for guix-patches@gnu.org; Wed, 02 Nov 2022 16:27:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oqKKE-0001bt-D0 for guix-patches@gnu.org; Wed, 02 Nov 2022 16:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqKKE-0002pt-8K for guix-patches@gnu.org; Wed, 02 Nov 2022 16:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58972] [PATCH 1/3] guix: ui: Handle single outputs. References: In-Reply-To: Resent-From: Liliana Marie Prikler Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 02 Nov 2022 20:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58972 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58972@debbugs.gnu.org Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , Leo Famulari , Maxime Devos , zimoun Received: via spool by 58972-submit@debbugs.gnu.org id=B58972.166742078010839 (code B ref 58972); Wed, 02 Nov 2022 20:27:02 +0000 Received: (at 58972) by debbugs.gnu.org; 2 Nov 2022 20:26:20 +0000 Received: from localhost ([127.0.0.1]:47244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqKJY-0002of-C5 for submit@debbugs.gnu.org; Wed, 02 Nov 2022 16:26:20 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:45758) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqKJX-0002oL-5R for 58972@debbugs.gnu.org; Wed, 02 Nov 2022 16:26:19 -0400 Received: by mail-ed1-f66.google.com with SMTP id a67so55749edf.12 for <58972@debbugs.gnu.org>; Wed, 02 Nov 2022 13:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:content-transfer-encoding:cc:to:subject :date:from:from:to:cc:subject:date:message-id:reply-to; bh=urLfQ4p9KbM/hLUfH9gdTHIJwNTkQq2SD59GwgRIA2M=; b=QOTY6zYIrVZw+c9EurfeSviYflEYOia908w+x1Lniu0X46iEa0KkIVWpJWqIql1ZtD 0lFMBXuuSyobP8yGesxOHTBUTyZxAeZrdDqb8uMddWQaUbTbdd/s7tGVGiAVX348/pZM wEnTUs2D4fX10mQDrwqQsdQR1RClqWtZm8zi8lq11Ds8sTA9BcvipUCbDsJyaOceaJpd HfjGDvJYgqsCBO27kXIPVs7DjsRZHtQAZcloibWIQk2UHuPe0+I1hs24nSaNCZlOfyRy Ffh1bWwEJTCs4OYaj93Kmlsqwv/OcVmGJX9RX2yNv9SWcyF7Tmc0c1glXEStr+chx82e PYYg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:content-transfer-encoding:cc:to:subject :date:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=urLfQ4p9KbM/hLUfH9gdTHIJwNTkQq2SD59GwgRIA2M=; b=3JQHvwwc9u0vjx4wYnStSTXBv95PxOJXUeaNi1haM/ifEYLm2PlpbYSvWHVp76dnSZ CJYjkj85PtSfer8LHndyDVNmCWLTPIF1MbdHtMHO1xgUDfUcAg21/A86OVbYBUivHMqy 0knvKsEuIiXrGrqIOMScMZrg734OnAdE0JaV6dH4QV2WKV6DjBYqdKl+b9P8e0TuCc27 bnuiqMT/E5cQ1t+5W4mlYJt5FWg7IocufdLVnHNRCCF1g/Wji6GolesGhZrywmsAXqx4 iZf5I8UZr1YnKfhe0xRhFDL5DAzClDMVN0IwnYC7dkvU3KLj/z59nauPfvO73p+j6zAT 1ZNw== X-Gm-Message-State: ACrzQf0FioD1EBIQl2qN4WaWpzDvLg6PnPmo0MPtcFrJsY8QCRjUGm/p MP08jJCMSwo3gezXF5GiN09XO1vKWAc= X-Google-Smtp-Source: AMsMyM6mVEBq111+8vD/0qDjKNLAhZZ9DNR5wuf/SfsQn6qedZj1ZIAhVeZpizuzTo1R+jCCxu9D/w== X-Received: by 2002:a05:6402:371b:b0:460:ff7d:f511 with SMTP id ek27-20020a056402371b00b00460ff7df511mr26806557edb.148.1667420773137; Wed, 02 Nov 2022 13:26:13 -0700 (PDT) Received: from lumine.fritz.box (85-127-52-93.dsl.dynamic.surfer.at. [85.127.52.93]) by smtp.gmail.com with ESMTPSA id e17-20020a170906045100b007aa239cf4d9sm5798951eja.89.2022.11.02.13.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 13:26:12 -0700 (PDT) From: Liliana Marie Prikler Date: Wed, 2 Nov 2022 21:01:30 +0100 Content-Transfer-Encoding: 7bit Message-ID: <27e3e24474785ec4cf75607b4cdec9631a081bcd.camel@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1667420836; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=urLfQ4p9KbM/hLUfH9gdTHIJwNTkQq2SD59GwgRIA2M=; b=Xb16VXZDqBDM1PYyGPwdWbaQAJWIyAWEpJUVdECLJeTfh8Nen13xrQ/uWsDZBGeGXSwnAE oUrF7bem+eHlctIWQO0x6dvW/wcIVPvu7AgW2qWLpELTO3VqaB8qLV+lq5ZDLnp9wodzzc Oaq9oZUQznyTZ62qyi1X8jc+fkhZj0lUcB1hiHJK0cppSisUx6sp/0Ak1NNhH4NZ320x+p IjnlLaG5Qxgx/S6ZKGX6rbYDLeAkBCDLUvHwpY8EVb/f8JL2xptNc2oNwVGzzSB4/oSa5h 4WJFpCh0TPA7zuaF9LC1iygYh/I4hvNK/+IkSR8NFcQucUNkRjISGimYQU8PgQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667420836; a=rsa-sha256; cv=none; b=L3wk7wGwXv3hIO9Jmev38QxjrRnNNJNoOstsWrPGgcX8g3S8hRNS6mR+6DDAhkYXkFUY3g SjxBS/T2C+TuF2MKAw9oDxAxnublN4xaDaFmIV4dVfKRSB0ma+rmD/AT2c8jdiAZyuUXo+ Y03ue1JmJBIhZnp/jjWef4YdHZIeWEj3Tlowa7KoS20HWtp80pAduNe7r8Qs9nYX47LsfI Om3XmCKKwiB/m60L1vhTogOCMm+uiO51mQsUddIFIfSU41JHJOQtDvPurwICPB6nYW7/i3 mcf1gv+60rjZnfysIPrpz+5rheYopNpNLmIjYBQ/hwgoSHnAsWMFjYiVkoUbLA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QOTY6zYI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: 7.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=QOTY6zYI; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1BCCC1B314 X-Spam-Score: 7.01 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0SKzpq9kuGbH 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 packagerecutils 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