[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/04: refresh: Add '--expression'.

From: Ludovic Courtès
Subject: 04/04: refresh: Add '--expression'.
Date: Mon, 23 Nov 2015 16:48:44 +0000

civodul pushed a commit to branch master
in repository guix.

commit 2d7fc7daf14e6e965a4d33baa7b9d52873f37691
Author: Ludovic Courtès <address@hidden>
Date:   Mon Nov 23 17:47:22 2015 +0100

    refresh: Add '--expression'.
    * guix/scripts/refresh.scm (%options, show-help): Add --expression.
    (guix-refresh): Honor it.
    * doc/guix.texi (Invoking guix refresh): Document it.
 doc/guix.texi            |   13 +++++++++++++
 guix/scripts/refresh.scm |    7 +++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 233c371..03363c1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4277,6 +4277,19 @@ The following options are supported:
 @table @code
address@hidden address@hidden
address@hidden -e @var{expr}
+Consider the package @var{expr} evaluates to.
+This is useful to precisely refer to a package, as in this example:
+guix refresh -l -e '(@@@@ (gnu packages commencement) glibc-final)'
address@hidden example
+This command lists the dependents of the ``final'' libc (essentially all
+the packages.)
 @item --update
 @itemx -u
 Update distribution source files (package recipes) in place.  This is
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index c9eff7b..8e8a34b 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -80,6 +80,9 @@
         (option '(#\L "list-updaters") #f #f
                 (lambda args
+        (option '(#\e "expression") #t #f
+                (lambda (opt name arg result)
+                  (alist-cons 'expression arg result)))
         (option '(#\l "list-dependent") #f #f
                 (lambda (opt name arg result)
                   (alist-cons 'list-dependent? #t result)))
@@ -116,6 +119,8 @@ When PACKAGE... is given, update only the specified 
packages.  Otherwise
 update all the packages of the distribution, or the subset thereof
 specified with `--select'.\n"))
   (display (_ "
+  -e, --expression=EXPR  consider the package EXPR evaluates to"))
+  (display (_ "
   -u, --update           update source files in place"))
   (display (_ "
   -s, --select=SUBSET    select all the packages in SUBSET, one of
@@ -348,6 +353,8 @@ update would trigger a complete rebuild."
                                 ;; Take either the specified version or the
                                 ;; latest one.
                                 (specification->package spec))
+                               (('expression . exp)
+                                (read/eval-package-expression exp))
                                (_ #f))
             (()                                   ; default to all packages

reply via email to

[Prev in Thread] Current Thread [Next in Thread]