Do not suggest `guix pull --news' after first pull

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • pelzflorian (Florian Pelz)
Owner
unassigned
Submitted by
pelzflorian (Florian Pelz)
Severity
normal

Debbugs page

pelzflorian (Florian Pelz) wrote 4 years ago
(address . bug-guix@gnu.org)
20201115015630.aknnrsoggtsabmfo@pelzflorian.localdomain
After doing a `guix pull` on the new VM image
the following is displayed:

Toggle quote (4 lines)
> hint: Run `guix pull --news' to read all the news.
>
> hint: After setting `PATH', run `hash guix' to make sure your shell refers to `/home/guest/.config/guix/current/bin/guix'.

The former `guix pull --news` is without effect (it is the very first
time I did a `guix pull`). It is a no-op. Users should not get the
suggestion to run `guix pull --news`.


Within (guix scripts pull)’ build-and-install procedure, the value of
(display-channel-news-headlines profile) is <unspecified>.

The attached patch changes it to return #f. I have verified running
`guix pull --news' is not suggested anymore with it (although I have
not tested if news are still displayed).

It would perhaps be nicer if the news since version 1.2.0 were
displayed, but I do not know how to make it so. I guess since the
original guix package must come from the guix package in (gnu packages
package-management), it is impossible to determine the version from
which news should be computed.

Regards,
Florian
From 8da37dc91f2f82da5f1da0ed2b6f0c0602599e5c Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 14 Nov 2020 23:36:52 +0100
Subject: [PATCH] pull: Do not suggest running `guix pull --news' on the first
run.

* guix/scripts/pull.scm (display-channel-news-headlines): If there
are no news to display, return false instead of <unspecified>.
---
guix/scripts/pull.scm | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

Toggle diff (25 lines)
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index bb1b560a22..38405fb79d 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -385,7 +385,7 @@ previous generation. Return true if there are news to display."
(and=> (relative-generation profile -1)
(cut generation-file-name profile <>)))
- (when previous
+ (if previous
(let ((old-channels (profile-channels previous))
(new-channels (profile-channels profile)))
;; Find the channels present in both PROFILE and PREVIOUS, and print
@@ -405,7 +405,8 @@ previous generation. Return true if there are news to display."
#:concise? #t)))
channels))
- (any ->bool more?))))))
+ (any ->bool more?))))
+ #f))
(define (display-news profile)
;; Display profile news, with the understanding that this process represents
--
2.29.1
pelzflorian (Florian Pelz) wrote 4 years ago
(address . 44650@debbugs.gnu.org)
20201115151717.myo6hcb5prambmho@pelzflorian.localdomain
On Sun, Nov 15, 2020 at 02:56:30AM +0100, pelzflorian (Florian Pelz) wrote:
Toggle quote (13 lines)
> - (when previous
> + (if previous
> (let ((old-channels (profile-channels previous))
> (new-channels (profile-channels profile)))
> ;; Find the channels present in both PROFILE and PREVIOUS, and print
> @@ -405,7 +405,8 @@ previous generation. Return true if there are news to display."
> #:concise? #t)))
> channels))
>
> - (any ->bool more?))))))
> + (any ->bool more?))))
> + #f))

I changed the patch to use `and` instead of `if` (attached). I
confirmed that channel news display fine on a later `guix pull`.

Should I add a copyright line? I believe no.

Regards,
Florian
From 8b1557004f618a47d4bea3a65a5b88c4cb718c4c Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 14 Nov 2020 23:36:52 +0100
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: [PATCH] pull: Do not suggest running `guix pull --news' on the first
run.

* guix/scripts/pull.scm (display-channel-news-headlines): If there
are no news to display, return false instead of <unspecified>.
---
guix/scripts/pull.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index bb1b560a22..7fd8b3f1a4 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -385,7 +385,7 @@ previous generation. Return true if there are news to display."
(and=> (relative-generation profile -1)
(cut generation-file-name profile <>)))
- (when previous
+ (and previous
(let ((old-channels (profile-channels previous))
(new-channels (profile-channels profile)))
;; Find the channels present in both PROFILE and PREVIOUS, and print
--
2.29.1
Ludovic Courtès wrote 4 years ago
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(address . 44650@debbugs.gnu.org)
87eektzg9f.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (2 lines)
> Should I add a copyright line? I believe no.

Yeah, probably not.

Toggle quote (11 lines)
> From 8b1557004f618a47d4bea3a65a5b88c4cb718c4c Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Sat, 14 Nov 2020 23:36:52 +0100
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit
> Subject: [PATCH] pull: Do not suggest running `guix pull --news' on the first
> run.
>
> * guix/scripts/pull.scm (display-channel-news-headlines): If there
> are no news to display, return false instead of <unspecified>.

Perfect, you can push to ‘version-1.2.0’, thank you!

Ludo’.
pelzflorian (Florian Pelz) wrote 4 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 44650-done@debbugs.gnu.org)
20201116135551.7k5kggstlsmw2unn@pelzflorian.localdomain
On Mon, Nov 16, 2020 at 12:35:08PM +0100, Ludovic Courtès wrote:
Toggle quote (4 lines)
> Perfect, you can push to ‘version-1.2.0’, thank you!
>
> Ludo’.

Thank you. Pushed as 29ed17d6345d30b0646f0a9b63ab201e0e6871ec. Done.

Regards,
Florian
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 44650@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 44650
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help