all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex Kost <alezost@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH] refresh: Add '--list-updaters' option.
Date: Thu, 22 Oct 2015 11:17:04 +0300	[thread overview]
Message-ID: <87611z9v27.fsf@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

I think this option may be useful.  Also it will be used (in the
upcoming patch) by emacs shell completions (as now --list-checkers is
used to complete "guix lint --checkers=").


[-- Attachment #2: 0001-refresh-Add-list-updaters-option.patch --]
[-- Type: text/x-patch, Size: 2881 bytes --]

From 6d82f6384902e7de837a4dbfc86c524dbfd9145a Mon Sep 17 00:00:00 2001
From: Alex Kost <alezost@gmail.com>
Date: Thu, 22 Oct 2015 10:51:17 +0300
Subject: [PATCH] refresh: Add '--list-updaters' option.

* guix/scripts/refresh.scm (list-updaters-and-exit): New procedure.
  (%options, show-help): Add '--list-updaters' option.
* doc/guix.texi (Invoking guix refresh): Document it.
---
 doc/guix.texi            |  4 ++++
 guix/scripts/refresh.scm | 14 ++++++++++++++
 2 files changed, 18 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 99c10d8..b94b780 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -4305,6 +4305,10 @@ be used when passing @command{guix refresh} one or more package names:
 
 @table @code
 
+@item --list-updaters
+@itemx -L
+List available updaters and exit.
+
 @item --list-dependent
 @itemx -l
 List top-level dependent packages that would need to be rebuilt as a
diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm
index 6f7ca4a..3e29c4e 100644
--- a/guix/scripts/refresh.scm
+++ b/guix/scripts/refresh.scm
@@ -2,6 +2,7 @@
 ;;; 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>
+;;; Copyright © 2015 Alex Kost <alezost@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -69,6 +70,9 @@
         (option '(#\t "type") #t #f
                 (lambda (opt name arg result)
                   (alist-cons 'updater (string->symbol arg) result)))
+        (option '(#\L "list-updaters") #f #f
+                (lambda args
+                   (list-updaters-and-exit)))
         (option '(#\l "list-dependent") #f #f
                 (lambda (opt name arg result)
                   (alist-cons 'list-dependent? #t result)))
@@ -112,6 +116,8 @@ specified with `--select'.\n"))
   (display (_ "
   -t, --type=UPDATER     restrict to updates from UPDATER--e.g., 'gnu'"))
   (display (_ "
+  -L, --list-updaters    list available updaters and exit"))
+  (display (_ "
   -l, --list-dependent   list top-level dependent packages that would need to
                          be rebuilt as a result of upgrading PACKAGE..."))
   (newline)
@@ -149,6 +155,14 @@ specified with `--select'.\n"))
           (eq? name (upstream-updater-name updater)))
         %updaters))
 
+(define (list-updaters-and-exit)
+  "Display available updaters and exit."
+  (format #t (_ "Available updaters:~%"))
+  (for-each (lambda (updater)
+              (format #t "- ~a~%" (upstream-updater-name updater)))
+            %updaters)
+  (exit 0))
+
 (define* (update-package store package updaters
                          #:key (key-download 'interactive))
   "Update the source file that defines PACKAGE with the new version.
-- 
2.5.0


             reply	other threads:[~2015-10-22  8:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-22  8:17 Alex Kost [this message]
2015-10-25 21:46 ` [PATCH] refresh: Add '--list-updaters' option Ludovic Courtès
2015-10-26 19:28   ` [PATCH] upstream: Add 'description' field to 'upstream-updater' Alex Kost
2015-10-27 17:26     ` Ludovic Courtès
2015-10-27 18:59       ` Alex Kost

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87611z9v27.fsf@gmail.com \
    --to=alezost@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.