summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--guix/scripts/package.scm14
-rw-r--r--tests/guix-package.sh3
2 files changed, 12 insertions, 5 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index dab3d5bb0c..66505f172f 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -956,11 +956,15 @@ more information.~%"))
         (('list-generations pattern)
          (define (list-generation number)
            (unless (zero? number)
-             (format #t (_ "Generation ~a\t~a~%") number
-                     (date->string
-                      (time-utc->date
-                       (generation-time profile number))
-                      "~b ~d ~Y ~T"))
+             (let ((header (format #f (_ "Generation ~a\t~a") number
+                                   (date->string
+                                    (time-utc->date
+                                     (generation-time profile number))
+                                    "~b ~d ~Y ~T")))
+                   (current (generation-number profile)))
+               (if (= number current)
+                   (format #t (_ "~a\t(current)~%") header)
+                   (format #t "~a~%" header)))
              (for-each (match-lambda
                         ((name version output location _)
                          (format #t "  ~a\t~a\t~a\t~a~%"
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 524ff32f17..5f97aff026 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -119,6 +119,9 @@ then
     test "`readlink_base "$profile"`" = "$profile-1-link"
     test -x "$profile/bin/guile" && ! test -x "$profile/bin/make"
 
+    # Check that the first generation is the current one.
+    test "`guix package -p "$profile" -l 1 | cut -f3 | head -n1`" = "(current)"
+
     # Roll-back to generation 0, and install---all at once.
     guix package --bootstrap -p "$profile" --roll-back -i guile-bootstrap
     test "`readlink_base "$profile"`" = "$profile-1-link"