aboutsummaryrefslogtreecommitdiff
path: root/guix/scripts
diff options
context:
space:
mode:
authorNikita Karetnikov <nikita@karetnikov.org>2013-09-25 01:55:27 +0000
committerNikita Karetnikov <nikita@karetnikov.org>2013-09-25 16:10:40 +0000
commit9ac9360d6e86e7d16756d8e28ce61e288551c2db (patch)
tree4e27796e0d8d71a2264491dc8d0344e0d9222c29 /guix/scripts
parentaad5af9f40951bac7c8822b754aa20946b2cb8a4 (diff)
downloadgnu-guix-9ac9360d6e86e7d16756d8e28ce61e288551c2db.tar
gnu-guix-9ac9360d6e86e7d16756d8e28ce61e288551c2db.tar.gz
guix package: Show which generation is the current one.
* guix/scripts/package.scm (guix-package)[process-query]: Show that a generation is the current one if the profile points to it. * tests/guix-package.sh: Test it.
Diffstat (limited to 'guix/scripts')
-rw-r--r--guix/scripts/package.scm14
1 files changed, 9 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~%"