From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH] refresh: Add '--list-updaters' option. Date: Thu, 22 Oct 2015 11:17:04 +0300 Message-ID: <87611z9v27.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36435) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpB3Z-0004qU-1l for guix-devel@gnu.org; Thu, 22 Oct 2015 04:17:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpB3U-0001Mq-8P for guix-devel@gnu.org; Thu, 22 Oct 2015 04:17:04 -0400 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]:34415) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpB3U-0001MG-0Y for guix-devel@gnu.org; Thu, 22 Oct 2015 04:17:00 -0400 Received: by lfaz124 with SMTP id z124so38861832lfa.1 for ; Thu, 22 Oct 2015 01:16:59 -0700 (PDT) Received: from leviafan ([217.107.192.146]) by smtp.gmail.com with ESMTPSA id g7sm2139024lbs.10.2015.10.22.01.16.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Oct 2015 01:16:58 -0700 (PDT) List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@gnu.org --=-=-= Content-Type: text/plain 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="). --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-refresh-Add-list-updaters-option.patch Content-Transfer-Encoding: quoted-printable >From 6d82f6384902e7de837a4dbfc86c524dbfd9145a Mon Sep 17 00:00:00 2001 From: Alex Kost 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 m= ore package names: =20 @table @code =20 +@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 =C2=A9 2013, 2014, 2015 Ludovic Court=C3=A8s ;;; Copyright =C2=A9 2013 Nikita Karetnikov ;;; Copyright =C2=A9 2014 Eric Bavier +;;; Copyright =C2=A9 2015 Alex Kost ;;; ;;; 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=3DUPDATER 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)) =20 +(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. --=20 2.5.0 --=-=-=--