mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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.
This commit is contained in:
parent
aad5af9f40
commit
9ac9360d6e
2 changed files with 12 additions and 5 deletions
|
@ -956,11 +956,15 @@ (define (process-query opts)
|
|||
(('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~%"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue