summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-02-05 22:56:53 +0100
committerLudovic Courtès <ludo@gnu.org>2021-02-05 23:15:36 +0100
commitfada92bb807aabd514ad20b86ad3a35a7ccbc9e7 (patch)
tree766f8da63940c525bfc77b201775d9553b862f6d
parent9c4b266ae5b6374fd6be22e59a1d3a82b598dc8d (diff)
downloadguix-fada92bb807aabd514ad20b86ad3a35a7ccbc9e7.tar.gz
guix describe: 'display-profile-content' checks the right generation.
Fixes a regression introduced in
316fc2acbb112bfa572ae30f95a93bcd56621234, whereby 'guix pull -l' would
always display channel information corresponding to the latest profile
generation.

Reported by Vagrant Cascadian.

* guix/scripts/describe.scm (profile-generation-channels): New
procedure.
(display-profile-content): Change default value of 'channels'.
-rw-r--r--guix/scripts/describe.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/scripts/describe.scm b/guix/scripts/describe.scm
index cd5d3838a8..6f8d9aceec 100644
--- a/guix/scripts/describe.scm
+++ b/guix/scripts/describe.scm
@@ -211,9 +211,17 @@ what matters."
                   channels))))
   (display-package-search-path fmt))
 
+(define (profile-generation-channels profile number)
+  "Return the list of channels for generation NUMBER of PROFILE."
+  (profile-channels (if (zero? number)
+                        profile
+                        (generation-file-name profile number))))
+
 (define* (display-profile-content profile number
                                   #:optional
-                                  (channels (profile-channels profile)))
+                                  (channels
+                                   (profile-generation-channels profile
+                                                                number)))
   "Display CHANNELS along with PROFILE info, generation NUMBER, in a
 human-readable way and displaying details about the channel's source code.
 PROFILE and NUMBER "