From patchwork Mon Feb 14 16:41:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37246 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4148D27BBEA; Mon, 14 Feb 2022 16:43:14 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id A6BB427BBE9 for ; Mon, 14 Feb 2022 16:43:13 +0000 (GMT) Received: from localhost ([::1]:57520 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJeRU-0002BJ-Qn for patchwork@mira.cbaines.net; Mon, 14 Feb 2022 11:43:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:42148) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJeRL-0002AX-5w for guix-patches@gnu.org; Mon, 14 Feb 2022 11:43:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJeRK-0001wa-T3 for guix-patches@gnu.org; Mon, 14 Feb 2022 11:43:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJeRK-0005vR-Ru for guix-patches@gnu.org; Mon, 14 Feb 2022 11:43:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54000] [PATCH 1/2] pull: '--news' no longer shows package lists. References: <20220214163838.1174-1-ludo@gnu.org> In-Reply-To: <20220214163838.1174-1-ludo@gnu.org> Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Feb 2022 16:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54000 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54000@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 54000-submit@debbugs.gnu.org id=B54000.164485692522676 (code B ref 54000); Mon, 14 Feb 2022 16:43:02 +0000 Received: (at 54000) by debbugs.gnu.org; 14 Feb 2022 16:42:05 +0000 Received: from localhost ([127.0.0.1]:42410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJeQO-0005tg-PU for submit@debbugs.gnu.org; Mon, 14 Feb 2022 11:42:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35070) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJeQ8-0005sJ-LA for 54000@debbugs.gnu.org; Mon, 14 Feb 2022 11:42:03 -0500 Received: from [2001:470:142:3::e] (port=35196 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJeQ2-0001pE-KV; Mon, 14 Feb 2022 11:41:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=254UCkUIsfJ5cUqPTNyF0f83wlEIhI8E98dEK8FrvEk=; b=kiUxumpmQ0xNMC BS767d3r816EkQfw4Lxiq+yfYw+r9DyMu6V3n6rFmAXHlqxx3LwV3vKMyKoOTe737EjRLdiRnhVO/ ROl9C6wA39YkW1TjkOGV3u2JRu2hwSni99/Ldozn/vY61wO1SQ/Y2mrNQVlsryoS/oTWvABaifs/C 4zbmkxTjxmig5zKpRMzazO3DKCHNAj52p3Co2z2OJanzRHeTsU9JT/7048XPXyoJKB9avoLkm7KRr wpWdQG/uGSiQb7kk5zYfPew5cGczonzLvJNOLwPsC3ETWdZ3CjkSqU3p4zNg1b3GhHY7Yd1XNPVMt 5/j+cDLfV1L1Ta4O3pJg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56752 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJeQ0-0003TG-RK; Mon, 14 Feb 2022 11:41:42 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 14 Feb 2022 17:41:26 +0100 Message-Id: <20220214164127.1248-1-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/pull.scm (display-channel-news): Return #t when news were displayed. (display-news): Remove call to 'display-profile-news'. Print something when there were no news. (process-query): For 'display-news', call 'display-channel-news' directly. * doc/guix.texi (Invoking guix pull): Adjust accordingly. --- doc/guix.texi | 10 ++--- guix/scripts/pull.scm | 93 ++++++++++++++++++++++++------------------- 2 files changed, 55 insertions(+), 48 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index a05f073c3d..534414ab8a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4486,13 +4486,11 @@ information. @cindex channel news @item --news @itemx -N -Display the list of packages added or upgraded since the previous -generation, as well as, occasionally, news written by channel authors -for their users (@pxref{Channels, Writing Channel News}). +Display news written by channel authors for their users for changes made +since the previous generation (@pxref{Channels, Writing Channel News}). -The package information is the same as displayed upon @command{guix -pull} completion, but without ellipses; it is also similar to the output -of @command{guix pull -l} for the last generation (see below). +You can view that information for previous generations with +@command{guix pull -l}. @item --list-generations[=@var{pattern}] @itemx -l [@var{pattern}] diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 205697b3bd..af1b27d7dd 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -352,45 +352,48 @@ (define* (display-channel-news profile (previous (and=> (relative-generation profile -1) (cut generation-file-name profile <>)))) - "Display news about the channels of PROFILE compared to PREVIOUS." - (when previous - (let ((old-channels (profile-channels previous)) - (new-channels (profile-channels profile))) - (and (pair? old-channels) (pair? new-channels) - (begin - (match (lset-difference channel=? new-channels old-channels) - (() - #t) - (new - (let ((count (length new))) - (format (current-error-port) - (N_ " ~a new channel:~%" - " ~a new channels:~%" count) - count) - (for-each display-channel new)))) - (match (lset-difference channel=? old-channels new-channels) - (() - #t) - (removed - (let ((count (length removed))) - (format (current-error-port) - (N_ " ~a channel removed:~%" - " ~a channels removed:~%" count) - count) - (for-each display-channel removed)))) + "Display news about the channels of PROFILE compared to PREVIOUS. Return +true if news were displayed, false otherwise." + (and previous + (let ((old-channels (profile-channels previous)) + (new-channels (profile-channels profile))) + (and (pair? old-channels) (pair? new-channels) + (begin + (match (lset-difference channel=? new-channels old-channels) + (() + #t) + (new + (let ((count (length new))) + (format (current-error-port) + (N_ " ~a new channel:~%" + " ~a new channels:~%" count) + count) + (for-each display-channel new)))) + (match (lset-difference channel=? old-channels new-channels) + (() + #t) + (removed + (let ((count (length removed))) + (format (current-error-port) + (N_ " ~a channel removed:~%" + " ~a channels removed:~%" count) + count) + (for-each display-channel removed)))) - ;; Display channel-specific news for those channels that were - ;; here before and are still around afterwards. - (for-each (match-lambda - ((new old) - (display-channel-specific-news new old))) - (filter-map (lambda (new) - (define old - (find (cut channel=? new <>) - old-channels)) + ;; Display channel-specific news for those channels that were + ;; here before and are still around afterwards. + (fold (match-lambda* + (((new old) news?) + (or (display-channel-specific-news new old) + news?))) + #f + (filter-map (lambda (new) + (define old + (find (cut channel=? new <>) + old-channels)) - (and old (list new old))) - new-channels))))))) + (and old (list new old))) + new-channels))))))) (define* (display-channel-news-headlines profile) "Display the titles of news about the channels of PROFILE compared to its @@ -422,12 +425,18 @@ (define more? (any ->bool more?)))))) (define (display-news profile) - ;; Display profile news, with the understanding that this process represents - ;; the newest generation. - (display-profile-news profile - #:current-is-newer? #t) + "Display channel news for PROFILE compared to its previous generation." + (define previous + (relative-generation profile -1)) - (display-channel-news profile)) + (if previous + (unless (display-channel-news profile + (generation-file-name profile previous)) + (info (G_ "no channel news since generation ~a~%") previous) + (display-hint (G_ "Run @command{guix pull -l} to view the +news for earlier generations."))) + (leave (G_ "profile ~a does not have a previous generation~%") + profile))) (define* (build-and-install instances profile) "Build the tool from SOURCE, and install it in PROFILE. When DRY-RUN? is From patchwork Mon Feb 14 16:41:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 37245 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 007D227BBEA; Mon, 14 Feb 2022 16:42:09 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C3BE227BBE9 for ; Mon, 14 Feb 2022 16:42:09 +0000 (GMT) Received: from localhost ([::1]:57296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nJeQS-0001xx-VY for patchwork@mira.cbaines.net; Mon, 14 Feb 2022 11:42:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:41780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJeQM-0001xl-R0 for guix-patches@gnu.org; Mon, 14 Feb 2022 11:42:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48510) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJeQM-0001qC-Hq for guix-patches@gnu.org; Mon, 14 Feb 2022 11:42:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nJeQM-0005t6-H9 for guix-patches@gnu.org; Mon, 14 Feb 2022 11:42:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54000] [PATCH 2/2] pull: No longer print upgraded/added packages upon completion. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 14 Feb 2022 16:42:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54000 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54000@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 54000-submit@debbugs.gnu.org id=B54000.164485691022611 (code B ref 54000); Mon, 14 Feb 2022 16:42:02 +0000 Received: (at 54000) by debbugs.gnu.org; 14 Feb 2022 16:41:50 +0000 Received: from localhost ([127.0.0.1]:42407 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJeQA-0005sb-HU for submit@debbugs.gnu.org; Mon, 14 Feb 2022 11:41:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:35080) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nJeQ9-0005sL-MK for 54000@debbugs.gnu.org; Mon, 14 Feb 2022 11:41:50 -0500 Received: from [2001:470:142:3::e] (port=35200 helo=fencepost.gnu.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nJeQ4-0001pW-CU; Mon, 14 Feb 2022 11:41:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=0PJ+bJpVAn05qFtaavKnZQaDClSddbCAoIccmacGIM4=; b=Pb9uHz0YhGgLx4PQYQdo 13f1X5DTz8kJYKfFkGsdiEjQb1DbpHrL7ABTfDqGQew62YzCjAOJ3uetBgn2yejPRz4fEODznm/U+ q6KfqeaVtUzWEchfjkVJwM0r2C44+KB/MFWYcmsumBDGF+yekk88HMHTFtrBfK1xH1DpQtQrBCl/i 9Ipd0gHOBmHN7mr1fppYUUzVyTL3v710iwtXal3rU3AWst7KJ/K5LfvaK9yr3sh8X7nJ1r/pewlYQ kE1AwCUVTtKY4P4ZWlopuigivQSU6DE2NJXRtIi+XcmxdJ6Qi0vdExa0Q0aVrZuk73Q4jDmo6t+uu SuEGo80amTpC2g==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:56752 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nJeQ2-0003TG-Tr; Mon, 14 Feb 2022 11:41:44 -0500 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Mon, 14 Feb 2022 17:41:27 +0100 Message-Id: <20220214164127.1248-2-ludo@gnu.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20220214164127.1248-1-ludo@gnu.org> References: <20220214164127.1248-1-ludo@gnu.org> 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/pull.scm (build-and-install): Remove call to 'display-profile-news' and adjust accordingly. --- guix/scripts/pull.scm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index af1b27d7dd..f557aaf79a 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -454,10 +454,9 @@ (define guix-command #:hooks %channel-profile-hooks) (return - (let ((more? (list (display-profile-news profile #:concise? #t) - (display-channel-news-headlines profile)))) + (let ((more? (display-channel-news-headlines profile))) (newline) - (when (any ->bool more?) + (when more? (display-hint (G_ "Run @command{guix pull --news} to read all the news."))))) (if guix-command