From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 aAX6GrckZGNh/wAAbAwnHQ (envelope-from ) for ; Thu, 03 Nov 2022 21:29:43 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 8PKsGrckZGOoJAAAauVa8A (envelope-from ) for ; Thu, 03 Nov 2022 21:29:43 +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 257B6283DA for ; Thu, 3 Nov 2022 21:29:43 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oqgpl-0005XU-2Z; Thu, 03 Nov 2022 16:29:05 -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 1oqgpi-0005Wr-NJ for guix-patches@gnu.org; Thu, 03 Nov 2022 16:29:04 -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 1oqgpi-0005vN-GL for guix-patches@gnu.org; Thu, 03 Nov 2022 16:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oqgpi-0006cd-BV for guix-patches@gnu.org; Thu, 03 Nov 2022 16:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58972] [PATCH v2 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: Thu, 03 Nov 2022 20:29: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.166750730625394 (code B ref 58972); Thu, 03 Nov 2022 20:29:02 +0000 Received: (at 58972) by debbugs.gnu.org; 3 Nov 2022 20:28:26 +0000 Received: from localhost ([127.0.0.1]:50883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqgp8-0006bQ-81 for submit@debbugs.gnu.org; Thu, 03 Nov 2022 16:28:26 -0400 Received: from mail-ej1-f66.google.com ([209.85.218.66]:39757) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oqgp7-0006bA-Bq for 58972@debbugs.gnu.org; Thu, 03 Nov 2022 16:28:25 -0400 Received: by mail-ej1-f66.google.com with SMTP id b2so8400403eja.6 for <58972@debbugs.gnu.org>; Thu, 03 Nov 2022 13:28:25 -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=VR7diOCuwb5TQMy1dGVe4LFK6Zu6h38yNm7fELpvsBs=; b=FDpcSzws10qy6kHP8L1Ym/ZiYc1DN44udXvGv7VFazRbfVqzMCX03M9stzCuYUJuVK vDtDk7q3ifFpkkGGkinay5CUuEcEh+3n/2M7a+5u5B52/nU259J1Chs4WdlvICkpoUW8 TI5texLKUJo+JmiSEzDkeBJEUPufa7mgnVHJqrvvOEnqI0VcBIZ5lNyuZ5MAgJMz6zCQ xy0cYLJq0zV1TXILzKr/4WIX6a5wLMrxeNIvlUBdtySjsjNQwiWzX8rNbwTW+ZxJ6CTQ tQNqUxjdmR4r7C15cCoj+sKSr3XpzvGHBXPdD9GHRMLALcUDDvnQCXiIIDfCa83rTKZa Ru9Q== 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=VR7diOCuwb5TQMy1dGVe4LFK6Zu6h38yNm7fELpvsBs=; b=SgF6LlJtXLYo9LTsgomIDSHbhWsFgb2D8vipJukrwxihQkRcn1fJhbrmIZkVMcfgbz 9718mbdpvyJxJZDMobWzeuRe+eRaQC5FE7CBL0KJ/v99nAWsaNa9LA2veIOr05oX4EOE CH52ImOl8oYCZuIjCbED9YVxkVZuYXnSm1RMTfX3FzW1klRqlNbOxo1NicR0Wok7aXQm VfbLcS+GBXK3lYmu4emGHCvavRVUlVGkcRFOikbP+z5FBr91HNbSp7hasjujd6fkxG5G 2P8wxu0HjOpvCKxk/U3e9C2mQD1ZYij343VI+Jh2GmRzpf1xsGD8nMplNndRszfoXCuk Mc6w== X-Gm-Message-State: ACrzQf0DR3XRaaS+g6Avl65f9g2VQHlkAlOfDomH+D4wgTHo8HtvTeKU OpMawQp09DOTWYIqD9DDf9ANMSIaU18= X-Google-Smtp-Source: AMsMyM5zevQyFKJdqN6M7ktCTa9EJnC1l7AjMHwkPS4fTjpUlFmLG3LIUoP5gmPer2Lz3hOGa4SNdg== X-Received: by 2002:a17:906:d96f:b0:7ad:f0af:5c07 with SMTP id rp15-20020a170906d96f00b007adf0af5c07mr14556064ejb.572.1667507299298; Thu, 03 Nov 2022 13:28:19 -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 l2-20020a1709063d2200b00730bfe6adc4sm914691ejf.37.2022.11.03.13.28.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Nov 2022 13:28:18 -0700 (PDT) From: Liliana Marie Prikler Date: Wed, 2 Nov 2022 21:01:30 +0100 Content-Transfer-Encoding: 7bit Message-ID: 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=1667507383; 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=VR7diOCuwb5TQMy1dGVe4LFK6Zu6h38yNm7fELpvsBs=; b=m2BDgk0kzIGRneXE5cnROsA+Ar5vnya8ZOkvu+lyaffvxCv8VknBITIz1I4RC4aO2fx/mm YzvWg9k1fJZluIC5QesWtURDhTMk+y+5PeE1mN+zkmblO/BQhr5vVhjnQQ99Z4t5KVV7hr 9T5lya+dXPwKbuWvmwWrz8ShhD1TOoycLAFbeoToebUct1CtH4m2YVZOneheUCrUE/VtM7 zbd2XflZUV+h5/+IlnQroDvdQTCDyvLtK7NkpbNFLEyOV/GlC7G+8NddI0XTqrQkMDD9dS Q7dN+ok9pfEYQnPPyV4Ss2Jei5Mb5pglVFtaUpdP8AGrbJQDeYbXYPXI8sTMqw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1667507383; a=rsa-sha256; cv=none; b=XmttvBoHf7AJnLE3P05Z1WngRThzofPlENvexw2Rj5qwIe6n5P6D/Xyt/DPE3WCdEHyKzv 7iM3d1zIzhvVpSBJpESm97d5svuUNWdYf8Gl7hJE2bLFgTw78aIulJqhYmampX1oAHprTD lWvTHfIfYetHE/qN1AJ/a2s5jnlsLb3QJdpc0ULhRbrzgEyt6e7JgPdMBV+qwejnCjAFhO 1g9AYVGzTRk1Q2QtnihvSCkaUWTINjS1U/wDzN/6F5r0deZuG7NjSp3wk4yF9Ydx0xzT9m 9lI3zvh7Rx4ZN583mAS3VBv/IZWAwS1Ic8w17nL1dhJD83Gx3hp5oIrmYQnPTg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=FDpcSzws; 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: 10.01 X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=FDpcSzws; 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: 257B6283DA X-Spam-Score: 10.01 X-Migadu-Spam: Yes X-Migadu-Scanner: scn1.migadu.com X-TUID: RIRZXjZHemKh 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..0f9a4dc187 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" + (alist-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