From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: [PATCH] upstream: Add 'description' field to 'upstream-updater'. Date: Mon, 26 Oct 2015 22:28:26 +0300 Message-ID: <87mvv51lb9.fsf_-_@gmail.com> References: <87611z9v27.fsf@gmail.com> <87611uk4f3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZqnRY-000089-1M for guix-devel@gnu.org; Mon, 26 Oct 2015 15:28:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZqnRU-0003wj-Q2 for guix-devel@gnu.org; Mon, 26 Oct 2015 15:28:31 -0400 In-Reply-To: <87611uk4f3.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sun, 25 Oct 2015 22:46:08 +0100") 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: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s (2015-10-26 00:46 +0300) wrote: > Alex Kost skribis: > >> 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. > > [...] > >> +@item --list-updaters >> +@itemx -L >> +List available updaters and exit. > > Maybe add: =E2=80=9C(see @option{--type} below.)=E2=80=9D As I put it right after =E2=80=98--type=E2=80=99 option, I'll use =E2=80=9C= above=E2=80=9D, not =E2=80=9Cbelow=E2=80=9D. > OK to push with this change! Thanks! I think I better modify it so that =E2=80=98guix lint --list-check= ers=E2=80=99 will also display descriptions, and I push it after (with) the attached patch. > To make it even more useful, I wonder if we should add a =E2=80=98descrip= tion=E2=80=99 > field to updaters. I like it! > The best way to do that would probably be by definition > with =E2=80=98define-record-type*=E2=80=99 (because = =E2=80=98description=E2=80=99 is > a known keyword for xgettext, as per po/guix/Makevars.) > > WDYT? Great, thanks for the pointers! The patch is attached (I hope I missed nothing there). --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-upstream-Add-description-field-to-upstream-updater.patch Content-Transfer-Encoding: quoted-printable >From 19cee5ca983f663117d272382d7063d48e273cd0 Mon Sep 17 00:00:00 2001 From: Alex Kost Date: Mon, 26 Oct 2015 21:24:53 +0300 Subject: [PATCH] upstream: Add 'description' field to 'upstream-updater'. MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Suggested by Ludovic Court=C3=A8s . * guix/upstream.scm (): Use 'define-record-type*'. [description]: New field. (lookup-updater): Adjust accordingly. * guix/gnu-maintenance.scm (%gnu-updater): Likewise. * guix/import/cran.scm (%cran-updater): Likewise. * guix/import/elpa.scm (%elpa-updater): Likewise. --- guix/gnu-maintenance.scm | 8 +++++--- guix/import/cran.scm | 8 +++++--- guix/import/elpa.scm | 8 +++++--- guix/upstream.scm | 15 +++++++++------ 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/guix/gnu-maintenance.scm b/guix/gnu-maintenance.scm index 5af1b88..e1455cc 100644 --- a/guix/gnu-maintenance.scm +++ b/guix/gnu-maintenance.scm @@ -413,8 +413,10 @@ for instance, whose releases are now uploaded to elpa.= gnu.org." (gnu-package? package))) =20 (define %gnu-updater - (upstream-updater 'gnu - non-emacs-gnu-package? - latest-release*)) + (upstream-updater + (name 'gnu) + (description "Updater for GNU packages") + (pred non-emacs-gnu-package?) + (latest latest-release*))) =20 ;;; gnu-maintenance.scm ends here diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 6284c9e..4b53d5e 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -236,8 +236,10 @@ representation of the package page." (string-prefix? "r-" (package-name package))) =20 (define %cran-updater - (upstream-updater 'cran - cran-package? - latest-release)) + (upstream-updater + (name 'cran) + (description "Updater for CRAN packages") + (pred cran-package?) + (latest latest-release))) =20 ;;; cran.scm ends here diff --git a/guix/import/elpa.scm b/guix/import/elpa.scm index 37fc2b8..8c10668 100644 --- a/guix/import/elpa.scm +++ b/guix/import/elpa.scm @@ -272,8 +272,10 @@ as \"debbugs\"." (define %elpa-updater ;; The ELPA updater. We restrict it to packages hosted on elpa.gnu.org ;; because for other repositories, we typically grab the source elsewher= e. - (upstream-updater 'elpa - package-from-gnu.org? - latest-release)) + (upstream-updater + (name 'elpa) + (description "Updater for ELPA packages") + (pred package-from-gnu.org?) + (latest latest-release))) =20 ;;; elpa.scm ends here diff --git a/guix/upstream.scm b/guix/upstream.scm index 9300113..219ae05 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright =C2=A9 2010, 2011, 2012, 2013, 2014, 2015 Ludovic Court=C3= =A8s +;;; Copyright =C2=A9 2015 Alex Kost ;;; ;;; This file is part of GNU Guix. ;;; @@ -45,6 +46,7 @@ upstream-updater upstream-updater? upstream-updater-name + upstream-updater-description upstream-updater-predicate upstream-updater-latest =20 @@ -109,18 +111,19 @@ correspond to the same version." ;;; Auto-update. ;;; =20 -(define-record-type - (upstream-updater name pred latest) +(define-record-type* + upstream-updater make-upstream-updater upstream-updater? - (name upstream-updater-name) - (pred upstream-updater-predicate) - (latest upstream-updater-latest)) + (name upstream-updater-name) + (description upstream-updater-description) + (pred upstream-updater-predicate) + (latest upstream-updater-latest)) =20 (define (lookup-updater package updaters) "Return an updater among UPDATERS that matches PACKAGE, or #f if none of them matches." (any (match-lambda - (($ _ pred latest) + (($ _ _ pred latest) (and (pred package) latest))) updaters)) =20 --=20 2.5.0 --=-=-=--