From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 2/2] import: Add stackage importer and updater. Date: Wed, 08 Feb 2017 16:30:27 +0100 Message-ID: <877f50og30.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43129) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cbUCY-0002Uu-H4 for guix-devel@gnu.org; Wed, 08 Feb 2017 10:30:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cbUCU-00007J-38 for guix-devel@gnu.org; Wed, 08 Feb 2017 10:30:34 -0500 In-Reply-To: (Federico Beffa's message of "Tue, 7 Feb 2017 08:36:15 +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" To: Federico Beffa Cc: Guix-devel Hello Federico, Federico Beffa skribis: > From 50891dc929a21327405c6a3b58638126456deeed Mon Sep 17 00:00:00 2001 > From: Federico Beffa > Date: Mon, 6 Feb 2017 18:19:26 +0100 > Subject: [PATCH 2/2] import: Add stackage importer and updater. > > * guix/import/stackage.scm: New file. > * guix/scripts/import/stackage.scm: New file. > * Makefile.am (MODULES): Add new files. > * guix/scripts/import.scm (importers): Add "stackage". > * guix/scripts/refresh.scm (%updaters): Add %stackage-updater. > * doc/guix.texi (Invoking 'guix import'): Document the importer. > (Invoking 'guix refresh'): Add stackage to option --type valid values. Neat! [...] > +@item stackage > +@cindex stackage > +The @code{stackage} importer is a wrapper around the @code{hackage} one. > +It takes a package name, looks up the package version included in an LTS For the first occurrence of =E2=80=9CLTS=E2=80=9D: s/LTS/long-term support (LTS)/ > +;;; > +;;; Hackage importer low-level help functions > +;;; > + > +(define guix-package->hackage-name > + (@@ (guix import hackage) guix-package->hackage-name)) > + > +(define hackage-fetch > + (@@ (guix import hackage) hackage-fetch)) > + > +(define hackage-source-url > + (@@ (guix import hackage) hackage-source-url)) > + > +(define hackage-cabal-url > + (@@ (guix import hackage) hackage-cabal-url)) I=E2=80=99d suggest exporting these procedures from (guix import hackage) r= ather than using =E2=80=98@@=E2=80=99, which should really be a last resort. > +(define %stackage-updater > + (upstream-updater > + (name 'stackage) > + (description "Updater for Stackage LTS packages") > + (pred (@@ (guix import hackage) hackage-package?)) Likewise here, or use (upstream-updater-predicate hackage-updater). > + (if name-version > + (hackage->guix-package name-version > + #:include-test-dependencies? > + include-test-dependencies?) > + (begin > + (format (current-error-port) > + "guix import stackage: package not found: ~a~%" packag= e-name) > + #f)))) The =E2=80=98if=E2=80=99 is unnecessary here: (guix scripts import) produce= s an error message when an importer returns something other than a =E2=80=98package=E2= =80=99 sexp. > --- a/guix/scripts/refresh.scm > +++ b/guix/scripts/refresh.scm > @@ -40,6 +40,7 @@ > #:use-module (guix import elpa) > #:use-module (guix import cran) > #:use-module (guix import hackage) > + #:use-module (guix import stackage) > #:use-module (guix gnupg) > #:use-module (gnu packages) > #:use-module ((gnu packages commencement) #:select (%final-inputs)) > @@ -205,6 +206,7 @@ unavailable optional dependencies such as Guile-JSON." > %elpa-updater > %cran-updater > %bioconductor-updater > + %stackage-updater Because the dependency on Guile-JSON is still optional, you should remove the #:use-module above and this line and write: ((guix import stackage) =3D> %stackage-updater) I haven=E2=80=99t tested it, but this LGTM. Thank you! Ludo=E2=80=99.