guix package: Show most recently installed packages last.

Suggested by Andreas Enge <andreas@enge.fr>.

* guix/scripts/package.scm (guix-package)[list-generations,
  list-installed]: Reverse the result of 'manifest-packages'.
* doc/guix.texi (Invoking guix package): Document the order of packages
  for '--list-generations' and '--list-installed'.
This commit is contained in:
Ludovic Courtès 2013-09-22 21:50:11 +02:00
parent a7a4e6a4f7
commit bd9bde1cba
2 changed files with 15 additions and 8 deletions

View File

@ -608,7 +608,9 @@ suggest setting these variables to @code{@var{profile}/include} and
@item --list-generations[=@var{pattern}] @item --list-generations[=@var{pattern}]
@itemx -l [@var{pattern}] @itemx -l [@var{pattern}]
Return a list of generations along with their creation dates. Return a list of generations along with their creation dates; for each
generation, show the installed packages, with the most recently
installed packages shown last.
For each installed package, print the following items, separated by For each installed package, print the following items, separated by
tabs: the name of a package, its version string, the part of the package tabs: the name of a package, its version string, the part of the package
@ -692,9 +694,9 @@ version: 7.2alpha6
@item --list-installed[=@var{regexp}] @item --list-installed[=@var{regexp}]
@itemx -I [@var{regexp}] @itemx -I [@var{regexp}]
List currently installed packages in the specified profile. When List the currently installed packages in the specified profile, with the
@var{regexp} is specified, list only installed packages whose name most recently installed packages shown last. When @var{regexp} is
matches @var{regexp}. specified, list only installed packages whose name matches @var{regexp}.
For each installed package, print the following items, separated by For each installed package, print the following items, separated by
tabs: the package name, its version string, the part of the package that tabs: the package name, its version string, the part of the package that

View File

@ -965,9 +965,12 @@ more information.~%"))
((name version output location _) ((name version output location _)
(format #t " ~a\t~a\t~a\t~a~%" (format #t " ~a\t~a\t~a\t~a~%"
name version output location))) name version output location)))
(manifest-packages
(profile-manifest ;; Show most recently installed packages last.
(format #f "~a-~a-link" profile number)))) (reverse
(manifest-packages
(profile-manifest
(format #f "~a-~a-link" profile number)))))
(newline))) (newline)))
(cond ((not (file-exists? profile)) ; XXX: race condition (cond ((not (file-exists? profile)) ; XXX: race condition
@ -994,7 +997,9 @@ more information.~%"))
(regexp-exec regexp name)) (regexp-exec regexp name))
(format #t "~a\t~a\t~a\t~a~%" (format #t "~a\t~a\t~a\t~a~%"
name (or version "?") output path)))) name (or version "?") output path))))
installed)
;; Show most recently installed packages last.
(reverse installed))
#t)) #t))
(('list-available regexp) (('list-available regexp)