From unknown Wed Jun 18 00:25:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#56428 <56428@debbugs.gnu.org> To: bug#56428 <56428@debbugs.gnu.org> Subject: Status: [PATCH] home: Add -I, --list-installed option. Reply-To: bug#56428 <56428@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:25:20 +0000 retitle 56428 [PATCH] home: Add -I, --list-installed option. reassign 56428 guix-patches submitter 56428 Antero Mejr severity 56428 normal tag 56428 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Jul 06 15:14:01 2022 Received: (at submit) by debbugs.gnu.org; 6 Jul 2022 19:14:01 +0000 Received: from localhost ([127.0.0.1]:55202 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9ATF-0001gW-0Z for submit@debbugs.gnu.org; Wed, 06 Jul 2022 15:14:01 -0400 Received: from lists.gnu.org ([209.51.188.17]:49144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9ATC-0001gO-7z for submit@debbugs.gnu.org; Wed, 06 Jul 2022 15:13:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52008) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o9ATB-0007kj-Be for guix-patches@gnu.org; Wed, 06 Jul 2022 15:13:53 -0400 Received: from mout-p-102.mailbox.org ([2001:67c:2050:0:465::102]:44864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1o9AT7-00007Y-MC for guix-patches@gnu.org; Wed, 06 Jul 2022 15:13:53 -0400 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4LdTjG5nqMz9sQD for ; Wed, 6 Jul 2022 21:13:38 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1657134818; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gQ0kUq1xRu0HEkTmEvE+5Xs0oCdzDovfDNP0gwRaT9Q=; b=DIh8qhHPje9p0+bSXPT0uYQAN2cy8Tgc8ksLDaLESc2Qb9abISbmI1kom+eAygP+K6Sq8Q yM2/gvRp0Oak+PsZpubGxqNQ7+MzV6X0hYdqN+mayCiBLDjX+VSVE/5IAO+7ZCWduosBMr OxBp4oNJuOvHQHKyS4qFMTrxW6OVTHftxOsNW9mwCWkj9APuK2eKQDAd14yche7qAPkNxu frNQgW2I1/m1t3qzddicxm3sPkjREhga1qOAb7Zvy4VGEzsmKd/ae4sMxhaHarwCwwY/Ye J6FwOMJswLc3/YhuwMSym+W2pX230j1qJII9WX6d6Gl5yynYHjFUYss7adVxjw== From: Antero Mejr To: guix-patches@gnu.org Subject: [PATCH] home: Add -I, --list-installed option. Date: Wed, 6 Jul 2022 19:13:11 +0000 Message-Id: <20220706191311.14662-1-antero@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-ID: d6b8cddc3b3e81a9d59 X-MBO-RS-META: 5nyr9hggws9c7n18u65qecgrq99imktc X-Rspamd-Queue-Id: 4LdTjG5nqMz9sQD Received-SPF: pass client-ip=2001:67c:2050:0:465::102; envelope-from=antero@mailbox.org; helo=mout-p-102.mailbox.org X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_INVALID=0.1, DKIM_SIGNED=0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) * guix/scripts/package.scm (list-installed): New procedure. * guix/scripts/home.scm: Use it. --- guix/scripts/home.scm | 13 +++++++++++++ guix/scripts/package.scm | 30 +++++++++++++++++------------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 0f5c3388a1..7a5078fe3b 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Oleg Pykhalov ;;; Copyright © 2022 Ludovic Courtès +;;; Copyright © 2022 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -143,6 +144,10 @@ (define (show-help) use BACKEND for 'extension-graph' and 'shepherd-graph'")) (newline) (display (G_ " + -I, --list-installed[=REGEXP] + list installed packages matching REGEXP")) + (newline) + (display (G_ " -h, --help display this help and exit")) (display (G_ " -V, --version display version information and exit")) @@ -183,6 +188,14 @@ (define %options (option '("graph-backend") #t #f (lambda (opt name arg result) (alist-cons 'graph-backend arg result))) + (option '(#\I "list-installed") #f #t + (lambda (opt name arg result) + (pretty-print-table + (reverse + (list-installed (or arg "") + (list + (string-append %guix-home "/profile"))))) + (exit 0))) ;; Container options. (option '(#\N "network") #f #f diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 99a6cfaa29..144d18a626 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Simon Tournier ;;; Copyright © 2018 Steve Sprang ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2022 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -773,6 +774,21 @@ (define absolute (add-indirect-root store absolute)) +(define-public (list-installed regexp profiles) + (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) + (manifest (concatenate-manifests + (map profile-manifest profiles))) + (installed (manifest-entries manifest))) + (leave-on-EPIPE + (let ((rows (filter-map + (match-lambda + (($ name version output path _) + (and (regexp-exec regexp name) + (list name (or version "?") output path)))) + installed))) + ;; Show most recently installed packages last. + (reverse rows))))) + ;;; ;;; Queries and actions. @@ -824,19 +840,7 @@ (define (diff-profiles profile numbers) #t) (('list-installed regexp) - (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) - (manifest (concatenate-manifests - (map profile-manifest profiles))) - (installed (manifest-entries manifest))) - (leave-on-EPIPE - (let ((rows (filter-map - (match-lambda - (($ name version output path _) - (and (regexp-exec regexp name) - (list name (or version "?") output path)))) - installed))) - ;; Show most recently installed packages last. - (pretty-print-table (reverse rows))))) + (pretty-print-table (list-installed regexp profiles)) #t) (('list-available regexp) -- 2.36.1 From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 07 11:07:07 2022 Received: (at 56428) by debbugs.gnu.org; 7 Jul 2022 15:07:07 +0000 Received: from localhost ([127.0.0.1]:57608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9T5r-0005s2-PS for submit@debbugs.gnu.org; Thu, 07 Jul 2022 11:07:07 -0400 Received: from mout-p-202.mailbox.org ([80.241.56.172]:59624) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o9T5o-0005rV-Iz for 56428@debbugs.gnu.org; Thu, 07 Jul 2022 11:07:02 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4Lf0B44yr8z9sQH for <56428@debbugs.gnu.org>; Thu, 7 Jul 2022 17:06:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1657206412; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jmep6v4PGCpPVb4Gv6lVxdwlrYL9kcrWf5hBUAVTm8A=; b=fi+rypgSTDw5QcipP5NLniaZHKSrJujB1f0cx+CCiA2kGBfWcDhVoctlTwdfDRyhwA+WgV K4RauK24tAWXfZ/LnzI5bqGbAO2V6FYweUHmRwTBO0frAVyp9jrjV+oIPz9nBlgMYlSe+z 5Om0xBPruNRpOwQ+rMsIeOhLPndzkPaLvCbjGFlLNaRt+yGS2UASKDcmnswhxCvz/Fby7R RaBE8wvMWxhRstvm2/s/LPVRF5k+2dCNhBNOF18PZPswdjNF47ZRfNiWqLkVn41uxhryHz +9/VpIlgoEmCto1GgEmuveH8TLT8XMVak7hlejpajUkU3sYCfayUpOPBrBn+hg== From: Antero Mejr To: 56428@debbugs.gnu.org Subject: [PATCH] home: Add -I, --list-installed option. Date: Thu, 7 Jul 2022 15:06:44 +0000 Message-Id: <20220707150644.2349-1-antero@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-ID: 6692bf84f6fdb5e8f7a X-MBO-RS-META: 61kogsarh5aqg51qfg9wi7zgs4uyz4wu X-Rspamd-Queue-Id: 4Lf0B44yr8z9sQH X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: 56428 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * guix/scripts/package.scm (list-installed): New procedure. * guix/scripts/home.scm: Use it. --- Remove extra (reverse...) from last patch. guix/scripts/home.scm | 12 ++++++++++++ guix/scripts/package.scm | 30 +++++++++++++++++------------- 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 0f5c3388a1..b0b8412d8c 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Oleg Pykhalov ;;; Copyright © 2022 Ludovic Courtès +;;; Copyright © 2022 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -143,6 +144,10 @@ (define (show-help) use BACKEND for 'extension-graph' and 'shepherd-graph'")) (newline) (display (G_ " + -I, --list-installed[=REGEXP] + list installed packages matching REGEXP")) + (newline) + (display (G_ " -h, --help display this help and exit")) (display (G_ " -V, --version display version information and exit")) @@ -183,6 +188,13 @@ (define %options (option '("graph-backend") #t #f (lambda (opt name arg result) (alist-cons 'graph-backend arg result))) + (option '(#\I "list-installed") #f #t + (lambda (opt name arg result) + (pretty-print-table + (list-installed (or arg "") + (list + (string-append %guix-home "/profile")))) + (exit 0))) ;; Container options. (option '(#\N "network") #f #f diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 99a6cfaa29..02e91a0ee1 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Simon Tournier ;;; Copyright © 2018 Steve Sprang ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2022 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -773,6 +774,20 @@ (define absolute (add-indirect-root store absolute)) +(define-public (list-installed regexp profiles) + (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) + (manifest (concatenate-manifests + (map profile-manifest profiles))) + (installed (manifest-entries manifest))) + (leave-on-EPIPE + (let ((rows (filter-map + (match-lambda + (($ name version output path _) + (and (regexp-exec regexp name) + (list name (or version "?") output path)))) + installed))) + rows)))) + ;;; ;;; Queries and actions. @@ -824,19 +839,8 @@ (define (diff-profiles profile numbers) #t) (('list-installed regexp) - (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) - (manifest (concatenate-manifests - (map profile-manifest profiles))) - (installed (manifest-entries manifest))) - (leave-on-EPIPE - (let ((rows (filter-map - (match-lambda - (($ name version output path _) - (and (regexp-exec regexp name) - (list name (or version "?") output path)))) - installed))) - ;; Show most recently installed packages last. - (pretty-print-table (reverse rows))))) + ;; Show most recently installed packages last. + (pretty-print-table (reverse (list-installed regexp profiles))) #t) (('list-available regexp) -- 2.36.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 06:14:15 2022 Received: (at 56428) by debbugs.gnu.org; 12 Jul 2022 10:14:15 +0000 Received: from localhost ([127.0.0.1]:41715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBCuA-0000no-Hn for submit@debbugs.gnu.org; Tue, 12 Jul 2022 06:14:15 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:36129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBCu7-0000nC-Tr for 56428@debbugs.gnu.org; Tue, 12 Jul 2022 06:14:09 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id CE15B1C0005; Tue, 12 Jul 2022 10:14:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1657620841; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8tevDj4bUO1bsXCL1ZqVXmiOoFmYY12y0V5qC9fh9lA=; b=Wzq2LRBHjp/WQYhid1Mytru640LoD5w1yMOrVKoXrbi+LeA+fbiku+7RopESi8b/mbDVjz LwHak85xS7D+b+RsUnr0LTa7q3svRtowZAp3Oqbe+NyEZVPhWPk9X2YN0AdK4ZIhlVP476 UCs+/D0WvmzZEwcO75pcVkOnOtAYbYwu+CXCKCl5vtX4XhbZMjfXfbtPnYWEf4/emdDYk0 ZBlyAQMNtM4glvGwavAwdT8K/OANAjoKHi7zAgl428kgYC5ho7P/qT4erTQz3KEBN1u9ca F4ZBDeG+d0vOOhrATNEcMArjysAKRdHxOZeZX0OBGy/T+uzI7oHcx839U1pSFQ== From: Andrew Tropin To: Antero Mejr , 56428@debbugs.gnu.org Subject: Re: [bug#56428] [PATCH] home: Add -I, --list-installed option. In-Reply-To: <20220707150644.2349-1-antero@mailbox.org> References: <20220706191311.14662-1-antero@mailbox.org> <20220707150644.2349-1-antero@mailbox.org> Date: Tue, 12 Jul 2022 13:13:57 +0300 Message-ID: <87o7xu1vve.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: 56428 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-07-07 15:06, Antero Mejr via Guix-patches via wrote: Hi Antero, this is a good addition, thank you very much! A hint: use reroll-count when generating new revision of the patch and subject will become [PATCH v2], [PATCH v3] etc. > * guix/scripts/package.scm (list-installed): New procedure. > * guix/scripts/home.scm: Use it. > --- > Remove extra (reverse...) from last patch. > > guix/scripts/home.scm | 12 ++++++++++++ > guix/scripts/package.scm | 30 +++++++++++++++++------------- > 2 files changed, 29 insertions(+), 13 deletions(-) > > diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm > index 0f5c3388a1..b0b8412d8c 100644 > --- a/guix/scripts/home.scm > +++ b/guix/scripts/home.scm > @@ -4,6 +4,7 @@ > ;;; Copyright =C2=A9 2021 Pierre Langlois > ;;; Copyright =C2=A9 2021 Oleg Pykhalov > ;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2022 Antero Mejr > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -143,6 +144,10 @@ (define (show-help) > use BACKEND for 'extension-graph' and 'shepherd= -graph'")) > (newline) > (display (G_ " > + -I, --list-installed[=3DREGEXP] > + list installed packages matching REGEXP")) 1. guix home/system and guix package has slightly different cli: guix package --list-generations vs guix home/system list-generations I think that later is more apropriate, because: `guix package --remove=3Dhtop --list-installed` is possible, but doesn't make too much sense, and `guix home reconfigure ./he.scm list-installed` is not possible, because only one action at time can be specicified. Implementing this functionality as --argument makes it possible to type `guix home reconfigure ./he.scm --list-installed`, which again doesn't make much sense as in the example above. I advice either implement list-installed as a separate action or as an additional --argument to describe/list-generations action. 2. Would be good to mention it in doc/guix.texi. 3. It would be nice to implement the same for guix system. > + (newline) > + (display (G_ " > -h, --help display this help and exit")) > (display (G_ " > -V, --version display version information and exit")) > @@ -183,6 +188,13 @@ (define %options > (option '("graph-backend") #t #f > (lambda (opt name arg result) > (alist-cons 'graph-backend arg result))) > + (option '(#\I "list-installed") #f #t > + (lambda (opt name arg result) > + (pretty-print-table > + (list-installed (or arg "") > + (list > + (string-append %guix-home "/profile= ")))) > + (exit 0))) >=20=20 > ;; Container options. (option '(#\N "network") #f #f diff > --git a/guix/scripts/package.scm b/guix/scripts/package.scm index > 99a6cfaa29..02e91a0ee1 100644 --- a/guix/scripts/package.scm +++ > b/guix/scripts/package.scm @@ -11,6 +11,7 @@ ;;; Copyright =C2=A9 2020 > Simon Tournier ;;; Copyright =C2=A9 2018 Steve > Sprang ;;; Copyright =C2=A9 2022 Josselin Poiret > +;;; Copyright =C2=A9 2022 Antero Mejr > ;;; ;;; This file is part of GNU Guix. ;;; @@ > -773,6 +774,20 @@ (define absolute >=20=20 > (add-indirect-root store absolute)) >=20=20 > +(define-public (list-installed regexp profiles) To make it consistent with the rest of the module, I think it will better to use define and explicitly export list-installed in module definition at the top of the file. > + (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) > + (manifest (concatenate-manifests > + (map profile-manifest profiles))) > + (installed (manifest-entries manifest))) > + (leave-on-EPIPE > + (let ((rows (filter-map > + (match-lambda > + (($ name version output path _) > + (and (regexp-exec regexp name) > + (list name (or version "?") output path)))) > + installed))) > + rows)))) > + > > ;;; > ;;; Queries and actions. > @@ -824,19 +839,8 @@ (define (diff-profiles profile numbers) > #t) >=20=20 > (('list-installed regexp) > - (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) > - (manifest (concatenate-manifests > - (map profile-manifest profiles))) > - (installed (manifest-entries manifest))) > - (leave-on-EPIPE > - (let ((rows (filter-map > - (match-lambda > - (($ name version output path _) > - (and (regexp-exec regexp name) > - (list name (or version "?") output path))= )) > - installed))) > - ;; Show most recently installed packages last. > - (pretty-print-table (reverse rows))))) > + ;; Show most recently installed packages last. > + (pretty-print-table (reverse (list-installed regexp profiles))) > #t) >=20=20 > (('list-available regexp) Tested the patch, guix package -I, guix home -I filter-regex works good, but see my comments above. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmLNSWUACgkQIgjSCVjB 3rBUGA/8CEASxPKUccYwJNNO5vC6L2MewwKCrB7SbTJEQURaii79yqcKAiO9CIus A6u/S+7v7zM23v2HVym8BsCk2JOqoIJM1kL3DJmqZ4fsRqHWSdnyX43eQ4mdtp6J /JziR+tZvFLtljtPMs1V1tMeiLKd25XioNysId4zBHOArEEymE5tLhcnvocaDX6/ bl4Rx2tsOwL2R8J/+lOFnGEbphI+yp5W2U+kt+QGlx3lMBM/PO7ol+BmJLflP5Od qQEDIZ8D4j5zPccNNvfw9ojUmi/RKXyMJpkFDNaHFQt2gT0mWjMPhH+c4sqnU5xw AF7gdizJzNCUzdsMx7YluZ5rPhtPsYZU4MNMoBTGbQac+YkgEhTypcVb4o1gnxHd I6hXbCIRSavtoGHthfgwmjk21TpP9b08e55ItWiA5s4BDIBMvTwHJguJVWTCqfc3 1uacjhwuXt2GAxoGptM2/cYW8vOyjISi/mnY8RRz6Ajohw5X5pcBHgrvFhS9pgqP l+LKc/amihCqSMF9Kcb+0cPu/iIYnn0jVnkfV24DqUBzKP5rmaozXw/vXDB4hxFs KbIWtWHz195apUN7yzUfOpJk1fxmKyPDg51+1JOFYoD9iunivPLhULDmlvhNKQvf dwAd2w0/ndn/TaTKOD5gN7CSUlzkagLqTSqtxDex/RJRlAD6zhs= =8wb9 -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 18:50:28 2022 Received: (at 56428) by debbugs.gnu.org; 12 Jul 2022 22:50:28 +0000 Received: from localhost ([127.0.0.1]:43853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBOi0-0003Tl-Dk for submit@debbugs.gnu.org; Tue, 12 Jul 2022 18:50:28 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:38800) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBOhw-0003TK-Sw for 56428@debbugs.gnu.org; Tue, 12 Jul 2022 18:50:23 -0400 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4LjGDN4tQgz9sSh; Wed, 13 Jul 2022 00:50:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1657666212; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Epvhqh2AIMGuqhSBxYWYeMTNMkdDM9DyJfCZ9xV88cY=; b=l8q4XY2SheaBesB4aqw6AwYLP032jFwenIc4svovWC/h39GgIn59g/Jr8WOQn4kGJPcqiV ObHyr5kdvTz6Dinm8g1li6WqTvgeiTlo4Uq7O/BwKC1X24lNuel2Bqjm/858I8n32ze8l9 DAzOsrtVMID20JFncaAQT4JG7VfSUVkRVFfP+YSAiWOE/tA1Rn+DxhOMlcB2VLqqSUwoxW 2ikpZbXgEljJ0fMniZIhK4rxuB/hsbZJjUf/uQ+gIeDKlQ258gEMup3O5AMbB01yq08WaT 2Me11huNOlcziWYgjnWlWuFZbQpI9u+w9Mwcx5KiiAS5dFJd3+Tk3dkXckbqZQ== From: Antero Mejr To: 56428@debbugs.gnu.org Subject: [PATCH v3] home: Add -I, --list-installed option. Date: Tue, 12 Jul 2022 22:50:07 +0000 Message-Id: <20220712225007.23875-1-antero@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-MBO-RS-META: spfd9huqj7s453r1ndnmsca75mzdgwxe X-MBO-RS-ID: c845409391d707b8a37 X-Rspamd-Queue-Id: 4LjGDN4tQgz9sSh X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: 56428 Cc: andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) * guix/scripts/package.scm (list-installed): New procedure. * guix/scripts/home.scm: Use it. * guix/scripts/utils.scm (pretty-print-table): New argument "left-pad". * doc/guix.texi (Invoking Guix Home): Add information and example for --list-installed flag. --- doc/guix.texi | 15 ++++++++++++ guix/scripts/home.scm | 52 +++++++++++++++++++++++++++++----------- guix/scripts/package.scm | 31 ++++++++++++++---------- guix/utils.scm | 4 ++-- 4 files changed, 73 insertions(+), 29 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 097e4a362b..fc3a2d962d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -40312,6 +40312,17 @@ install anything. Describe the current home generation: its file name, as well as provenance information when available. +To show installed packages in the current home generation's profile, +the @code{--list-installed} flag is provided, with the same syntax that +is used in @command{guix package --list-installed} +(@pxref{Invoking guix package}). For instance, the following command +shows a table of all emacs-related packages installed in the +current home generation's profile, at the end of the description: + +@example +guix home describe --list-installed=emacs +@end example + @item list-generations List a summary of each generation of the home environment available on disk, in a human-readable way. This is similar to the @@ -40327,6 +40338,10 @@ generations that are up to 10 days old: $ guix home list-generations 10d @end example +The @code{--list-installed} flag may also be specified, with the same +syntax that is used in @command{guix home describe}. This may be helpful +if trying to determine when a package was added to the home profile. + @item import Generate a @dfn{home environment} from the packages in the default profile and configuration files found in the user's home directory. The diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm index 0f5c3388a1..97d626114a 100644 --- a/guix/scripts/home.scm +++ b/guix/scripts/home.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2021 Pierre Langlois ;;; Copyright © 2021 Oleg Pykhalov ;;; Copyright © 2022 Ludovic Courtès +;;; Copyright © 2022 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -143,6 +144,11 @@ (define (show-help) use BACKEND for 'extension-graph' and 'shepherd-graph'")) (newline) (display (G_ " + -I, --list-installed[=REGEXP] + for 'describe' or 'list-generations', list installed + packages matching REGEXP")) + (newline) + (display (G_ " -h, --help display this help and exit")) (display (G_ " -V, --version display version information and exit")) @@ -183,6 +189,9 @@ (define %options (option '("graph-backend") #t #f (lambda (opt name arg result) (alist-cons 'graph-backend arg result))) + (option '(#\I "list-installed") #f #t + (lambda (opt name arg result) + (alist-cons 'list-installed (or arg "") result))) ;; Container options. (option '(#\N "network") #f #f @@ -569,17 +578,20 @@ (define-syntax-rule (with-store* store exp ...) deploy the home environment described by these files.\n") destination)))) ((describe) - (match (generation-number %guix-home) - (0 - (leave (G_ "no home environment generation, nothing to describe~%"))) - (generation - (display-home-environment-generation generation)))) + (let ((list-installed-regex (assoc-ref opts 'list-installed))) + (match (generation-number %guix-home) + (0 + (leave (G_ "no home environment generation, nothing to describe~%"))) + (generation + (display-home-environment-generation + generation #:list-installed-regex list-installed-regex))))) ((list-generations) - (let ((pattern (match args + (let ((list-installed-regex (assoc-ref opts 'list-installed)) + (pattern (match args (() #f) ((pattern) pattern) (x (leave (G_ "wrong number of arguments~%")))))) - (list-generations pattern))) + (list-generations pattern #:list-installed-regex list-installed-regex))) ((switch-generation) (let ((pattern (match args ((pattern) pattern) @@ -748,7 +760,8 @@ (define (search . args) (define* (display-home-environment-generation number - #:optional (profile %guix-home)) + #:optional (profile %guix-home) + #:key (list-installed-regex #f)) "Display a summary of home-environment generation NUMBER in a human-readable format." (define (display-channel channel) @@ -782,9 +795,16 @@ (define-values (channels config-file) (format #t (G_ " configuration file: ~a~%") (if (supports-hyperlinks?) (file-hyperlink config-file) - config-file)))))) - -(define* (list-generations pattern #:optional (profile %guix-home)) + config-file))) + (when list-installed-regex + (format #t (G_ " packages:\n")) + (pretty-print-table (list-installed + list-installed-regex + (list (string-append generation "/profile"))) + #:left-pad 4))))) + +(define* (list-generations pattern #:optional (profile %guix-home) + #:key (list-installed-regex #f)) "Display in a human-readable format all the home environment generations matching PATTERN, a string. When PATTERN is #f, display all the home environment generations." @@ -792,14 +812,18 @@ (define* (list-generations pattern #:optional (profile %guix-home)) (raise (condition (&profile-not-found-error (profile profile))))) ((not pattern) - (for-each display-home-environment-generation (profile-generations profile))) + (for-each (cut display-home-environment-generation <> + #:list-installed-regex list-installed-regex) + (profile-generations profile))) ((matching-generations pattern profile) => (lambda (numbers) (if (null-list? numbers) (exit 1) - (leave-on-EPIPE - (for-each display-home-environment-generation numbers))))))) + (leave-on-EPIPE (for-each + (cut display-home-environment-generation <> + #:list-installed-regex list-installed-regex) + numbers))))))) ;;; diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 99a6cfaa29..af61b50222 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -11,6 +11,7 @@ ;;; Copyright © 2020 Simon Tournier ;;; Copyright © 2018 Steve Sprang ;;; Copyright © 2022 Josselin Poiret +;;; Copyright © 2022 Antero Mejr ;;; ;;; This file is part of GNU Guix. ;;; @@ -67,6 +68,7 @@ (define-module (guix scripts package) delete-generations delete-matching-generations guix-package + list-installed search-path-environment-variables manifest-entry-version-prefix @@ -773,6 +775,20 @@ (define absolute (add-indirect-root store absolute)) +(define (list-installed regexp profiles) + (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) + (manifest (concatenate-manifests + (map profile-manifest profiles))) + (installed (manifest-entries manifest))) + (leave-on-EPIPE + (let ((rows (filter-map + (match-lambda + (($ name version output path _) + (and (regexp-exec regexp name) + (list name (or version "?") output path)))) + installed))) + rows)))) + ;;; ;;; Queries and actions. @@ -824,19 +840,8 @@ (define (diff-profiles profile numbers) #t) (('list-installed regexp) - (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) - (manifest (concatenate-manifests - (map profile-manifest profiles))) - (installed (manifest-entries manifest))) - (leave-on-EPIPE - (let ((rows (filter-map - (match-lambda - (($ name version output path _) - (and (regexp-exec regexp name) - (list name (or version "?") output path)))) - installed))) - ;; Show most recently installed packages last. - (pretty-print-table (reverse rows))))) + ;; Show most recently installed packages last. + (pretty-print-table (reverse (list-installed regexp profiles))) #t) (('list-available regexp) diff --git a/guix/utils.scm b/guix/utils.scm index 745da98a79..8484442b29 100644 --- a/guix/utils.scm +++ b/guix/utils.scm @@ -1124,7 +1124,7 @@ (define* (string-closest trial tests #:key (threshold 3)) ;;; Prettified output. ;;; -(define* (pretty-print-table rows #:key (max-column-width 20)) +(define* (pretty-print-table rows #:key (max-column-width 20) (left-pad 0)) "Print ROWS in neat columns. All rows should be lists of strings and each row should have the same length. The columns are separated by a tab character, and aligned using spaces. The maximum width of each column is @@ -1143,7 +1143,7 @@ (define* (pretty-print-table rows #:key (max-column-width 20)) (map (cut min <> max-column-width) column-widths))) (fmt (string-append (string-join column-formats "\t") "\t~a"))) - (for-each (cut format #t "~?~%" fmt <>) rows))) + (for-each (cut format #t "~v_~?~%" left-pad fmt <>) rows))) ;;; Local Variables: ;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1) -- 2.36.1 From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 12 18:58:08 2022 Received: (at 56428) by debbugs.gnu.org; 12 Jul 2022 22:58:08 +0000 Received: from localhost ([127.0.0.1]:43867 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBOpU-0003fb-H5 for submit@debbugs.gnu.org; Tue, 12 Jul 2022 18:58:08 -0400 Received: from mout-p-101.mailbox.org ([80.241.56.151]:51128) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBOpS-0003ef-Df for 56428@debbugs.gnu.org; Tue, 12 Jul 2022 18:58:07 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4LjGPL1kgDz9sSH; Wed, 13 Jul 2022 00:57:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1657666678; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=P1mq4q8RH4cbrNGy6zoo7cGGXyTbv8mz6qSI6SPZUKw=; b=VyYHhhMM9ohtdakwN8Xr8VyKlo3d9d1gWozc50w8aFdusAsm5b5fsQfL1oxEfNrZ7CMy3A Npxjvz2nINT91Py0WXJNAEpX+0t/huySoDmANbYpplioaN0fGpUOnQkO2ftmRq4W9k4S/f EF5dZBLYXTjsWyO7QtsAVxT0w4HZU4qT4YvEfh4P0KmXhG/vYUmNbV9s+ewJqviHUPN2dc ySxtiePyq937hn4MEzLTQncoxVDHLAzGR4otWAyIbbt8wQIdCxpxz8US4aRAdyvmp63Xqg zwYLR5nlYOc86AQuBvIKpw5UCwWXI+KWj32W03lxqiHcwj8CwDBgvxn5UIiCAg== References: <20220706191311.14662-1-antero@mailbox.org> <20220707150644.2349-1-antero@mailbox.org> <87o7xu1vve.fsf@trop.in> From: Antero Mejr To: Andrew Tropin Subject: Re: [bug#56428] [PATCH] home: Add -I, --list-installed option. Date: Tue, 12 Jul 2022 22:50:19 +0000 In-reply-to: <87o7xu1vve.fsf@trop.in> Message-ID: <87pmiaj5vx.fsf@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain X-MBO-RS-ID: 71a3fa83636b0f9423e X-MBO-RS-META: 7z7zpaqaoh7ghizd5cpjsdk9gyqjksn3 X-Rspamd-Queue-Id: 4LjGPL1kgDz9sSH X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 56428 Cc: 56428@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Andrew Tropin writes: > Implementing this functionality as --argument makes it possible to type > `guix home reconfigure ./he.scm --list-installed`, which again doesn't > make much sense as in the example above. I advice either implement > list-installed as a separate action or as an additional --argument to > describe/list-generations action. I added it to both guix home describe and list-generations. Adding it to describe seems most intuitive to me, and adding it to list-generations is useful for tracking when a package was added to the profile. If --list-installed is specified for an invalid subcommand, the flag is ignored. Same behavior as when using --network with a guix home describe, for example. > 2. Would be good to mention it in doc/guix.texi. Done. > 3. It would be nice to implement the same for guix system. I will do that in another patch/issue. > To make it consistent with the rest of the module, I think it will > better to use define and explicitly export list-installed in module > definition at the top of the file. Done. Thanks for the review, and also thanks for guix home! From debbugs-submit-bounces@debbugs.gnu.org Thu Jul 14 05:21:40 2022 Received: (at 56428) by debbugs.gnu.org; 14 Jul 2022 09:21:40 +0000 Received: from localhost ([127.0.0.1]:48762 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBv2N-0001yW-U1 for submit@debbugs.gnu.org; Thu, 14 Jul 2022 05:21:40 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:53855) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oBv2L-0001yG-BV for 56428@debbugs.gnu.org; Thu, 14 Jul 2022 05:21:34 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 5AADD240006; Thu, 14 Jul 2022 09:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1657790486; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=FbmZy0sxD9suitqhkBnJD0lDTQl8WXSMj2OLyj7IJHQ=; b=mWunrNEPOKA5mnURz51Gcilj9GWVISd8F4yjn6NXmYc9V5F2iUbKGsI4ZU1Q4T2J/PR2AO GxkUQ5OiMUMp1FudHPhf6cyLLxvXdFpcVgKEobpQqaK059EYMyQSkgpor3JeYBqry6tHzb RGKvK1hpMiVpB5zmTWuOOGY5W08g6jjHN3DaSCGhNYnIVSD/KoPYRdlkMuOkYKiZFSenEC UZwC3CT+KKZuaJTjTlQq1hxxCqTNhymBM//aUP2T+0wS9A9StU64MBr7ATj45YytDVvPoD mzKXokCfQ3ju9d46edmcJ98AEgTGb/TceirAtiUL5Tcj1nPJEFoP+Wy5Hktr0g== From: Andrew Tropin To: Antero Mejr , 56428@debbugs.gnu.org Subject: Re: [PATCH v3] home: Add -I, --list-installed option. In-Reply-To: <20220712225007.23875-1-antero@mailbox.org> References: <20220712225007.23875-1-antero@mailbox.org> Date: Thu, 14 Jul 2022 12:21:23 +0300 Message-ID: <87wncgoxrg.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 0.9 (/) X-Debbugs-Envelope-To: 56428 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.1 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-07-12 22:50, Antero Mejr wrote: > * guix/scripts/package.scm (list-installed): New procedure. > * guix/scripts/home.scm: Use it. > * guix/scripts/utils.scm (pretty-print-table): New argument "left-pad". > * doc/guix.texi (Invoking Guix Home): Add information and example for > --list-installed flag. > --- > doc/guix.texi | 15 ++++++++++++ > guix/scripts/home.scm | 52 +++++++++++++++++++++++++++++----------- > guix/scripts/package.scm | 31 ++++++++++++++---------- > guix/utils.scm | 4 ++-- > 4 files changed, 73 insertions(+), 29 deletions(-) > > diff --git a/doc/guix.texi b/doc/guix.texi > index 097e4a362b..fc3a2d962d 100644 > --- a/doc/guix.texi > +++ b/doc/guix.texi > @@ -40312,6 +40312,17 @@ install anything. > Describe the current home generation: its file name, as well as > provenance information when available. >=20=20 > +To show installed packages in the current home generation's profile, > +the @code{--list-installed} flag is provided, with the same syntax that > +is used in @command{guix package --list-installed} > +(@pxref{Invoking guix package}). For instance, the following command > +shows a table of all emacs-related packages installed in the > +current home generation's profile, at the end of the description: > + > +@example > +guix home describe --list-installed=3Demacs > +@end example > + > @item list-generations > List a summary of each generation of the home environment available on > disk, in a human-readable way. This is similar to the > @@ -40327,6 +40338,10 @@ generations that are up to 10 days old: > $ guix home list-generations 10d > @end example >=20=20 > +The @code{--list-installed} flag may also be specified, with the same > +syntax that is used in @command{guix home describe}. This may be helpful > +if trying to determine when a package was added to the home profile. > + > @item import > Generate a @dfn{home environment} from the packages in the default > profile and configuration files found in the user's home directory. The > diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm > index 0f5c3388a1..97d626114a 100644 > --- a/guix/scripts/home.scm > +++ b/guix/scripts/home.scm > @@ -4,6 +4,7 @@ > ;;; Copyright =C2=A9 2021 Pierre Langlois > ;;; Copyright =C2=A9 2021 Oleg Pykhalov > ;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2022 Antero Mejr > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -143,6 +144,11 @@ (define (show-help) > use BACKEND for 'extension-graph' and 'shepherd= -graph'")) > (newline) > (display (G_ " > + -I, --list-installed[=3DREGEXP] > + for 'describe' or 'list-generations', list inst= alled > + packages matching REGEXP")) > + (newline) > + (display (G_ " > -h, --help display this help and exit")) > (display (G_ " > -V, --version display version information and exit")) > @@ -183,6 +189,9 @@ (define %options > (option '("graph-backend") #t #f > (lambda (opt name arg result) > (alist-cons 'graph-backend arg result))) > + (option '(#\I "list-installed") #f #t > + (lambda (opt name arg result) > + (alist-cons 'list-installed (or arg "") result))) >=20=20 > ;; Container options. > (option '(#\N "network") #f #f > @@ -569,17 +578,20 @@ (define-syntax-rule (with-store* store exp ...) > deploy the home environment described by these files.\n") > destination)))) > ((describe) > - (match (generation-number %guix-home) > - (0 > - (leave (G_ "no home environment generation, nothing to describe~= %"))) > - (generation > - (display-home-environment-generation generation)))) > + (let ((list-installed-regex (assoc-ref opts 'list-installed))) > + (match (generation-number %guix-home) > + (0 > + (leave (G_ "no home environment generation, nothing to describ= e~%"))) > + (generation > + (display-home-environment-generation > + generation #:list-installed-regex list-installed-regex))))) > ((list-generations) > - (let ((pattern (match args > + (let ((list-installed-regex (assoc-ref opts 'list-installed)) > + (pattern (match args > (() #f) > ((pattern) pattern) > (x (leave (G_ "wrong number of arguments~%")))))) > - (list-generations pattern))) > + (list-generations pattern #:list-installed-regex list-installed-r= egex))) > ((switch-generation) > (let ((pattern (match args > ((pattern) pattern) > @@ -748,7 +760,8 @@ (define (search . args) >=20=20 > (define* (display-home-environment-generation > number > - #:optional (profile %guix-home)) > + #:optional (profile %guix-home) > + #:key (list-installed-regex #f)) > "Display a summary of home-environment generation NUMBER in a > human-readable format." > (define (display-channel channel) > @@ -782,9 +795,16 @@ (define-values (channels config-file) > (format #t (G_ " configuration file: ~a~%") > (if (supports-hyperlinks?) > (file-hyperlink config-file) > - config-file)))))) > - > -(define* (list-generations pattern #:optional (profile %guix-home)) > + config-file))) > + (when list-installed-regex > + (format #t (G_ " packages:\n")) > + (pretty-print-table (list-installed > + list-installed-regex > + (list (string-append generation "/profile")= )) > + #:left-pad 4))))) > + > +(define* (list-generations pattern #:optional (profile %guix-home) > + #:key (list-installed-regex #f)) > "Display in a human-readable format all the home environment > generations matching PATTERN, a string. When PATTERN is #f, display > all the home environment generations." > @@ -792,14 +812,18 @@ (define* (list-generations pattern #:optional (prof= ile %guix-home)) > (raise (condition (&profile-not-found-error > (profile profile))))) > ((not pattern) > - (for-each display-home-environment-generation (profile-generati= ons profile))) > + (for-each (cut display-home-environment-generation <> > + #:list-installed-regex list-installed-regex) > + (profile-generations profile))) > ((matching-generations pattern profile) > =3D> > (lambda (numbers) > (if (null-list? numbers) > (exit 1) > - (leave-on-EPIPE > - (for-each display-home-environment-generation numbers)))= )))) > + (leave-on-EPIPE (for-each > + (cut display-home-environment-generation= <> > + #:list-installed-regex list-install= ed-regex) > + numbers))))))) >=20=20 > > ;;; > diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm > index 99a6cfaa29..af61b50222 100644 > --- a/guix/scripts/package.scm > +++ b/guix/scripts/package.scm > @@ -11,6 +11,7 @@ > ;;; Copyright =C2=A9 2020 Simon Tournier > ;;; Copyright =C2=A9 2018 Steve Sprang > ;;; Copyright =C2=A9 2022 Josselin Poiret > +;;; Copyright =C2=A9 2022 Antero Mejr > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -67,6 +68,7 @@ (define-module (guix scripts package) > delete-generations > delete-matching-generations > guix-package > + list-installed >=20=20 > search-path-environment-variables > manifest-entry-version-prefix > @@ -773,6 +775,20 @@ (define absolute >=20=20 > (add-indirect-root store absolute)) >=20=20 > +(define (list-installed regexp profiles) > + (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) > + (manifest (concatenate-manifests > + (map profile-manifest profiles))) > + (installed (manifest-entries manifest))) > + (leave-on-EPIPE > + (let ((rows (filter-map > + (match-lambda > + (($ name version output path _) > + (and (regexp-exec regexp name) > + (list name (or version "?") output path)))) > + installed))) > + rows)))) > + > > ;;; > ;;; Queries and actions. > @@ -824,19 +840,8 @@ (define (diff-profiles profile numbers) > #t) >=20=20 > (('list-installed regexp) > - (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) > - (manifest (concatenate-manifests > - (map profile-manifest profiles))) > - (installed (manifest-entries manifest))) > - (leave-on-EPIPE > - (let ((rows (filter-map > - (match-lambda > - (($ name version output path _) > - (and (regexp-exec regexp name) > - (list name (or version "?") output path))= )) > - installed))) > - ;; Show most recently installed packages last. > - (pretty-print-table (reverse rows))))) > + ;; Show most recently installed packages last. > + (pretty-print-table (reverse (list-installed regexp profiles))) > #t) >=20=20 > (('list-available regexp) > diff --git a/guix/utils.scm b/guix/utils.scm > index 745da98a79..8484442b29 100644 > --- a/guix/utils.scm > +++ b/guix/utils.scm > @@ -1124,7 +1124,7 @@ (define* (string-closest trial tests #:key (thresho= ld 3)) > ;;; Prettified output. > ;;; >=20=20 > -(define* (pretty-print-table rows #:key (max-column-width 20)) > +(define* (pretty-print-table rows #:key (max-column-width 20) (left-pad = 0)) > "Print ROWS in neat columns. All rows should be lists of strings and = each > row should have the same length. The columns are separated by a tab > character, and aligned using spaces. The maximum width of each column is > @@ -1143,7 +1143,7 @@ (define* (pretty-print-table rows #:key (max-column= -width 20)) > (map (cut min <> max-column-width) > column-widths))) > (fmt (string-append (string-join column-formats "\t") "\t~a"))) > - (for-each (cut format #t "~?~%" fmt <>) rows))) > + (for-each (cut format #t "~v_~?~%" left-pad fmt <>) rows))) >=20=20 > ;;; Local Variables: > ;;; eval: (put 'call-with-progress-reporter 'scheme-indent-function 1) Applied locally, tested, LGTM. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmLP4BMACgkQIgjSCVjB 3rAsZQ/8CZJpU7JY/lUlAynPFp6ZidiNyni5K6GWEC8YVfp2hZNJb5oFYQSnu4Qj nj8hYzWXw3d6Deb31sEUCFeRTgZ1RprMOj86RT3AEWDvM806cO/Px5JG+wASF1zW PhwmD7xZQbUKGSynUAfXipx8zencPzFdtw87lDBui+HyiCp+RzRiR7noefcj9SGQ 5Lw3VWyaRYY4/+145ufFTybBbD+sAKQU2hjnYV1RaiiNl4/2CFn0htTVmKzPPGLZ Dp7vnfE3vpFIjOZCMKOYDjoooHAQi+nEs4qw3MKpH314L1I+7wwPjw1hqD9idKj8 qQpHPGynGW3i2NTUZUAiEP/ArpSjl8OWnGUa/cPPVrCFo3fWGfAcRiDzHxdr/bhh f6pjIAhHjf/lCOlMtbWhaLIXK43EO/4AQ2CMkTk0Us3ShSQOXrVyKJ6Yiqc4gwKr yb1kq0THecBtFl7chPnxu957EtNygT1m9inHwL93ofM2XPonZPfJZRk96GjDrQez RuwLgqgqdZRDRcl0ABDAuOpC9dxD3VNQKPJ4sa6ILnp9XrTfD2q/4twhNLz+6gpU ZMj6BGCsgEyMpzaFk3ic5Tc3xbEDOFyFkMfriQe1voKG+QeQM3bMEDljsSxnVQxF rIGkieE84xe3xD1jYK6WTpnet/cHlyqr948bhT1EozCEt2Z8vNI= =P/kd -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 18 09:21:14 2022 Received: (at 56428-done) by debbugs.gnu.org; 18 Jul 2022 13:21:14 +0000 Received: from localhost ([127.0.0.1]:49541 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDQgU-0004xg-Cx for submit@debbugs.gnu.org; Mon, 18 Jul 2022 09:21:14 -0400 Received: from eggs.gnu.org ([209.51.188.92]:56772) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDQgR-0004xO-B2 for 56428-done@debbugs.gnu.org; Mon, 18 Jul 2022 09:21:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37286) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDQgL-0005Ao-HM; Mon, 18 Jul 2022 09:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=HOn5VnaTMbnqs/QVOQxSrT4p13Mc9WezpSfyecNR5rQ=; b=K0JmKe+AjWWCFzzHYkxG VLrv17pxevloYSeV4W9J2Brdbex1c99Xm2qYmS+QOshH3xI5mwsEh/0GjbJyCVGlRH3+h9sdK9asV 9I7XkhThuxoE25yWWMbHRBhytoQY4G5sVcpDyiwc5do4jna4/x93aHlmI6IdYSVN1/8LlryxlqiL2 6ItToEEB3CYzCXvHWjHlYagAassRyae3wDZTpwChSyjpn+6NCPuK5+gFund4frNgUtAujNcpmltwd qx4cCwenxAHmrYlbf2YRGy9lLqbzDEitjABX8HAwWF79/gu8iCrZ1hBxetJRIVL8pe5Yox+dKI1D5 ClLc7CpDLIeLPg==; Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=36030 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDQgL-0006VO-4G; Mon, 18 Jul 2022 09:21:05 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Antero Mejr Subject: Re: bug#56428: [PATCH] home: Add -I, --list-installed option. References: <20220706191311.14662-1-antero@mailbox.org> <20220712225007.23875-1-antero@mailbox.org> Date: Mon, 18 Jul 2022 15:21:03 +0200 In-Reply-To: <20220712225007.23875-1-antero@mailbox.org> (Antero Mejr's message of "Tue, 12 Jul 2022 22:50:07 +0000") Message-ID: <8735eyzhds.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 56428-done Cc: 56428-done@debbugs.gnu.org, andrew@trop.in X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Antero Mejr skribis: > * guix/scripts/package.scm (list-installed): New procedure. > * guix/scripts/home.scm: Use it. > * guix/scripts/utils.scm (pretty-print-table): New argument "left-pad". > * doc/guix.texi (Invoking Guix Home): Add information and example for > --list-installed flag. I tweaked the wording in the manual, added a docstring to =E2=80=98list-installed=E2=80=99 (info "(guix) Formatting Code"), adjusted = that of =E2=80=98pretty-print-table=E2=80=99, tweaked the commit log to list all th= e changes, and committed. Thanks! Ludo=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Fri Aug 05 02:12:21 2022 Received: (at 56428) by debbugs.gnu.org; 5 Aug 2022 06:12:21 +0000 Received: from localhost ([127.0.0.1]:55782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJqZJ-0004Ex-79 for submit@debbugs.gnu.org; Fri, 05 Aug 2022 02:12:21 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:40523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oJqZG-0004Eg-Iv for 56428@debbugs.gnu.org; Fri, 05 Aug 2022 02:12:19 -0400 Received: (Authenticated sender: andrew@trop.in) by mail.gandi.net (Postfix) with ESMTPSA id 4C11B40003; Fri, 5 Aug 2022 06:12:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=trop.in; s=gm1; t=1659679931; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XJhD04gDVHKeTQ2CiBVn6wWurJg7UuikD2dZ6z/puW4=; b=H80ObxwptvHxfq+w4Lq8Of2hvA76wD21FRyvISr7jvlXVH2zOHnurVHEgCOkqZ6S6t4wEV Ss5m2drHUYYHCfowfxdxQePRcxyEbn4c+DNXXzkwcUjLMJXfTn5Q1PoCUY9UpMhtrqfGnr /uBfp65c6T2c1z91ZvnT8dk09MGXKFhprZWBD5EPUkTuO3zn55YMV3fTR7ci7Uj5ca2+oV OqZNC/yTAGinKv1DnxLxzvj71ochGaOB71klGeaODEOy5e8vhhROYd937kPL6bDYyNV6Bx VD3bil7qIjWPo9pwUekXZiMER0yahFSLAWwXqkWdmyhqV0JUBD/6n6gWSSqbew== From: Andrew Tropin To: Antero Mejr , 56428@debbugs.gnu.org Subject: Re: [bug#56428] [PATCH] home: Add -I, --list-installed option. In-Reply-To: <20220706191311.14662-1-antero@mailbox.org> References: <20220706191311.14662-1-antero@mailbox.org> Date: Fri, 05 Aug 2022 09:12:06 +0300 Message-ID: <87fsibb4nd.fsf@trop.in> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 2022-07-06 19:13, Antero Mejr via Guix-patches via wrote: > * guix/scripts/package.scm (list-installed): New procedure. > * guix/scripts/home.scm: Use it. > --- > guix/scripts/home.scm | 13 +++++++++++++ > guix/scripts/package.scm | 30 +++++++++++++++++----- [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [217.70.183.194 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [217.70.183.194 listed in wl.mailspike.net] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 2.0 PDS_OTHER_BAD_TLD Untrustworthy TLDs [URI: jpoiret.xyz (xyz)] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-Debbugs-Envelope-To: 56428 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 2022-07-06 19:13, Antero Mejr via Guix-patches via wrote: > * guix/scripts/package.scm (list-installed): New procedure. > * guix/scripts/home.scm: Use it. > --- > guix/scripts/home.scm | 13 +++++++++++++ > guix/scripts/package.scm | 30 +++++++++++++++++------------- > 2 files changed, 30 insertions(+), 13 deletions(-) > > diff --git a/guix/scripts/home.scm b/guix/scripts/home.scm > index 0f5c3388a1..7a5078fe3b 100644 > --- a/guix/scripts/home.scm > +++ b/guix/scripts/home.scm > @@ -4,6 +4,7 @@ > ;;; Copyright =C2=A9 2021 Pierre Langlois > ;;; Copyright =C2=A9 2021 Oleg Pykhalov > ;;; Copyright =C2=A9 2022 Ludovic Court=C3=A8s > +;;; Copyright =C2=A9 2022 Antero Mejr > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -143,6 +144,10 @@ (define (show-help) > use BACKEND for 'extension-graph' and 'shepherd= -graph'")) > (newline) > (display (G_ " > + -I, --list-installed[=3DREGEXP] > + list installed packages matching REGEXP")) > + (newline) > + (display (G_ " > -h, --help display this help and exit")) > (display (G_ " > -V, --version display version information and exit")) > @@ -183,6 +188,14 @@ (define %options > (option '("graph-backend") #t #f > (lambda (opt name arg result) > (alist-cons 'graph-backend arg result))) > + (option '(#\I "list-installed") #f #t > + (lambda (opt name arg result) > + (pretty-print-table > + (reverse > + (list-installed (or arg "") > + (list > + (string-append %guix-home "/profil= e"))))) > + (exit 0))) >=20=20 > ;; Container options. > (option '(#\N "network") #f #f > diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm > index 99a6cfaa29..144d18a626 100644 > --- a/guix/scripts/package.scm > +++ b/guix/scripts/package.scm > @@ -11,6 +11,7 @@ > ;;; Copyright =C2=A9 2020 Simon Tournier > ;;; Copyright =C2=A9 2018 Steve Sprang > ;;; Copyright =C2=A9 2022 Josselin Poiret > +;;; Copyright =C2=A9 2022 Antero Mejr > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -773,6 +774,21 @@ (define absolute >=20=20 > (add-indirect-root store absolute)) >=20=20 > +(define-public (list-installed regexp profiles) > + (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) > + (manifest (concatenate-manifests > + (map profile-manifest profiles))) > + (installed (manifest-entries manifest))) > + (leave-on-EPIPE > + (let ((rows (filter-map > + (match-lambda > + (($ name version output path _) > + (and (regexp-exec regexp name) > + (list name (or version "?") output path)))) > + installed))) > + ;; Show most recently installed packages last. > + (reverse rows))))) > + > > ;;; > ;;; Queries and actions. > @@ -824,19 +840,7 @@ (define (diff-profiles profile numbers) > #t) >=20=20 > (('list-installed regexp) > - (let* ((regexp (and regexp (make-regexp* regexp regexp/icase))) > - (manifest (concatenate-manifests > - (map profile-manifest profiles))) > - (installed (manifest-entries manifest))) > - (leave-on-EPIPE > - (let ((rows (filter-map > - (match-lambda > - (($ name version output path _) > - (and (regexp-exec regexp name) > - (list name (or version "?") output path))= )) > - installed))) > - ;; Show most recently installed packages last. > - (pretty-print-table (reverse rows))))) > + (pretty-print-table (list-installed regexp profiles)) > #t) >=20=20 > (('list-available regexp) =2DI --list-installed works great, thank you. Just a thought for future: Maybe it would be useful to have another option to list all the packages in profile, including propagated. =2D-=20 Best regards, Andrew Tropin --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEKEGaxlA4dEDH6S/6IgjSCVjB3rAFAmLstLYACgkQIgjSCVjB 3rBnGw/6AyqaI/udt2cu9CYmo0f1WMs4RF0e1tGY/t1OnP0fIE2x9vP+b+7c/OHv Nt+bCAWJw4DSoPXNYdezxYUFaCfbx8i4/cOt0e2s607Q4FcpZ4Y3zbUIhjURfUsV 6iYrnj0HeycGxrZHu5v9qwKfCubRJsCaCumYkSzhmfYY237Igx+OlHFXTSitu4/Z zhnsqSNJERG5tCXJtB2N98iRPhJOm94g58xyNI4LGwUtvKJv15bGpU+MZitEQ7z+ 5EaXLeTco6/CVfcUvBQ3+nCbNi9AlirjT7gLFyjjYrDgClBzUsNq9FEYQUnE+LlD Xm4cz3budmoFZZVEKzYCSl1k1Tn5XFtgdR2RUghHBWi6sXQJecDUifOm1JM0Z6yo zg+0zhtC9K97vpV+g04BkTcAxAIfzDTGgVrgi+YPEaUUu+sPL+fUaZ0IH9PSUNH0 DE81cwhSIM0UZ8Mn5yK+6S5BDiXBRpuUs0SVGMVqmnTORZqYpvDCfOB7QhXEwOEu mKD08W0dsp3HupnlnO27+hpBlvIJ8zSytxgZhQh0UOdfLvzoy4jdFjcsF5LvWUzi 5kiEA42OGxWZFfYwiaydFdnLhdADktw6mnJcUD1WtbAKxXM1bvQSJrw3Wc+t46qe I47qnRYIRkKO7yy+pgt7JoCeCntTyPYlVsG8rIcGVMqUuej1pIc= =mGZe -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 06 20:14:07 2022 Received: (at 56428) by debbugs.gnu.org; 7 Aug 2022 00:14:07 +0000 Received: from localhost ([127.0.0.1]:35678 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKTvj-0004Dh-HI for submit@debbugs.gnu.org; Sat, 06 Aug 2022 20:14:07 -0400 Received: from mout-p-102.mailbox.org ([80.241.56.152]:58008) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oKTvd-0004D3-Rs for 56428@debbugs.gnu.org; Sat, 06 Aug 2022 20:14:06 -0400 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4M0fvR3Jh9z9sSR; Sun, 7 Aug 2022 02:13:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1659831235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NkmlPUzJaKoLEw9VRE/3SeMg88Gfo/PQp7ZS4nqNyfk=; b=GEEf8purBOUQ4Aa00zW95r+ZRA/4IsK1C+Ki58L+WPpT536EdT9g7WAKOYNzoHTVf7lc1j gvK+WirQ5fQrtgNipp+MoY7IN/NALLiqvuZmwgXy2jSN5Nc5MUIevUi2NlYX6dN82595wO CEV0UbNoh70OXPB8749ioUTAMJLdjRhMBIw6BnX5tUddIW51oFCNTS9wZdmtG4Kd8hFstJ yS0yEufix7tt4kdW9H1ImSXYJJQ+7jPk7c+d/oAFhfNSuJM83/yTuoGU4pDkiLDGtNpflx ieEV3WkjaHiHcxIrJoloI+mVg0RE2eTlIhdM4GSD+mPTn94nGUelHcwvIAwPOQ== References: <20220706191311.14662-1-antero@mailbox.org> <87fsibb4nd.fsf@trop.in> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1659831233; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NkmlPUzJaKoLEw9VRE/3SeMg88Gfo/PQp7ZS4nqNyfk=; b=ODfLBDIGVi5iezGo2iLXurIYx/qZHhChTe3ffN616rglP4vKWN8rqYHc1rEDhVQ7N+cHD0 hzAvqQrYiP6e8WjkccdGMlinh/rs27j7oJEBKsS1Tf4ZnGqQX3EmqlT9H/go1q0fD+dMG9 MRM4qZqaQrUXFCKwnHsQOmUFXPxPgQivBfVx8fSgZk35ZPGLkjmpSfGBRZpsKTCTRCQYMd ag+69zafDSK4N6EFGqFkRo+ED09+NVsQ738kPBP28ElzYnupJZ3+56b7buWhxhcpJe61tQ AwaVhu23fjEnu4rKtKhIlVJdrSmbTFGI7ti2N2rJUzre9t3SXTLdompaCcqKWg== From: Antero Mejr To: Andrew Tropin Subject: Re: [bug#56428] [PATCH] home: Add -I, --list-installed option. Date: Sat, 06 Aug 2022 19:02:13 -0400 In-reply-to: <87fsibb4nd.fsf@trop.in> Message-ID: <87o7wwhpw3.fsf@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-MBO-RS-ID: 5cebb206b1b799247e6 X-MBO-RS-META: t7mmurk9dy7sqf9z8oqf7jr33p1tgd3x X-Rspamd-Queue-Id: 4M0fvR3Jh9z9sSR X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 56428 Cc: 56428@debbugs.gnu.org, Antero Mejr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) Andrew Tropin writes: > -I --list-installed works great, thank you. Just a thought for future: > Maybe it would be useful to have another option to list all the packages > in profile, including propagated. Not sure I fully understand. For example, if a profile's package "foo" has input "bar" and propagated-input "baz": - would you want both "bar" and "baz" listed? - would you want to know the relationships between the packages? Could this could be done with 'guix graph' by adding an ascii backend, like this: guix graph --backend=3Dascii -t references $(readlink -f \ ~/.guix-home/profile) to get this: +------------+-------+-----------------+------+ | package |parent |type |etc...| +------------+-------+-----------------+------+ | foo |profile|parent | | +------------+-------+-----------------+------+ | bar |foo |input | | +------------+-------+-----------------+------+ | baz |foo |propagated-input | | +------------+-------+-----------------+------+ or this: foo =E2=94=9C=E2=94=80=E2=94=80 bar (input) =E2=94=94=E2=94=80=E2=94=80 baz (propagated-input) Maybe a 'guix sbom' subcommand, for "Software Bill of Materials", would be better for displaying lists like this. Having an SBOM exporter would make Guix great for regulated applications like medical device software. From unknown Wed Jun 18 00:25:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 04 Sep 2022 11:24:07 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator