summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-09-22 21:50:11 +0200
committerLudovic Courtès <ludo@gnu.org>2013-09-23 00:33:50 +0200
commitbd9bde1cba7190ed8b87aefbd09b1e25c5acbf31 (patch)
tree5bce6c29a30f57bfab37a712ced30e2d2a8580a9
parenta7a4e6a4f719da8d0b26d9a60ff8ed42691d263f (diff)
downloadguix-bd9bde1cba7190ed8b87aefbd09b1e25c5acbf31.tar.gz
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'.
-rw-r--r--doc/guix.texi10
-rw-r--r--guix/scripts/package.scm13
2 files changed, 15 insertions, 8 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index fdddcc52c3..9eb67ecd01 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -608,7 +608,9 @@ suggest setting these variables to @code{@var{profile}/include} and
 
 @item --list-generations[=@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
 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}]
 @itemx -I [@var{regexp}]
-List currently installed packages in the specified profile.  When
-@var{regexp} is specified, list only installed packages whose name
-matches @var{regexp}.
+List the currently installed packages in the specified profile, with the
+most recently installed packages shown last.  When @var{regexp} is
+specified, list only installed packages whose name matches @var{regexp}.
 
 For each installed package, print the following items, separated by
 tabs: the package name, its version string, the part of the package that
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index c0cedcd4a8..1d00e39540 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -965,9 +965,12 @@ more information.~%"))
                         ((name version output location _)
                          (format #t "  ~a\t~a\t~a\t~a~%"
                                  name version output location)))
-                       (manifest-packages
-                        (profile-manifest
-                         (format #f "~a-~a-link" profile number))))
+
+                       ;; Show most recently installed packages last.
+                       (reverse
+                        (manifest-packages
+                         (profile-manifest
+                          (format #f "~a-~a-link" profile number)))))
              (newline)))
 
          (cond ((not (file-exists? profile)) ; XXX: race condition
@@ -994,7 +997,9 @@ more information.~%"))
                                  (regexp-exec regexp name))
                          (format #t "~a\t~a\t~a\t~a~%"
                                  name (or version "?") output path))))
-                     installed)
+
+                     ;; Show most recently installed packages last.
+                     (reverse installed))
            #t))
 
         (('list-available regexp)