summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-04-16 23:13:28 +0200
committerLudovic Courtès <ludo@gnu.org>2015-04-16 23:15:06 +0200
commit4b9b3cbbc45afa3e374889847d4ab8673b8b2db2 (patch)
treeeee479452554b00485db2cf852865c0a6e81b480
parent77db91addc57faa000db05563820f57a9ffdedfc (diff)
downloadguix-4b9b3cbbc45afa3e374889847d4ab8673b8b2db2.tar.gz
refresh: Allow users to refer to specific package versions.
* guix/scripts/refresh.scm (guix-refresh): Use 'specification->package'
  instead of 'find-packages-by-name'.  This allows users to specify
  things like "qt-4.8.6".
* doc/guix.texi (Invoking guix refresh): Add an example.
-rw-r--r--doc/guix.texi2
-rw-r--r--guix/scripts/refresh.scm17
2 files changed, 8 insertions, 11 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 97fa3b6548..6b6604a426 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3285,7 +3285,7 @@ In addition, @command{guix refresh} can be passed one or more package
 names, as in this example:
 
 @example
-guix refresh -u emacs idutils
+guix refresh -u emacs idutils gcc-4.8.4
 @end example
 
 @noindent
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 04886499a2..28519d78e2 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
 ;;;
@@ -207,16 +207,13 @@ update would trigger a complete rebuild."
          (list-dependent? (assoc-ref opts 'list-dependent?))
          (key-download    (assoc-ref opts 'key-download))
          (packages
-          (match (concatenate
-                  (filter-map (match-lambda
-                               (('argument . value)
-                                (let ((p (find-packages-by-name value)))
-                                  (when (null? p)
-                                    (leave (_ "~a: no package by that name~%")
-                                           value))
-                                  p))
+          (match (filter-map (match-lambda
+                               (('argument . spec)
+                                ;; Take either the specified version or the
+                                ;; latest one.
+                                (specification->package spec))
                                (_ #f))
-                              opts))
+                             opts)
                  (()                          ; default to all packages
                   (let ((select? (match (assoc-ref opts 'select)
                                         ('core core-package?)