all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Federico Beffa <beffa@ieee.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH 2/2] import: Add stackage importer and updater.
Date: Wed, 08 Feb 2017 16:30:27 +0100	[thread overview]
Message-ID: <877f50og30.fsf@gnu.org> (raw)
In-Reply-To: <CAKrPhPPQKLOBd8Cma6qgS+Je7RKZZ_Emd+Kp15-LYkqd13GVkw@mail.gmail.com> (Federico Beffa's message of "Tue, 7 Feb 2017 08:36:15 +0100")

Hello Federico,

Federico Beffa <beffa@ieee.org> skribis:

> From 50891dc929a21327405c6a3b58638126456deeed Mon Sep 17 00:00:00 2001
> From: Federico Beffa <beffa@fbengineering.ch>
> 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 “LTS”:
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’d suggest exporting these procedures from (guix import hackage) rather
than using ‘@@’, 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~%" package-name)
> +          #f))))

The ‘if’ is unnecessary here: (guix scripts import) produces an error
message when an importer returns something other than a ‘package’ 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) => %stackage-updater)

I haven’t tested it, but this LGTM.

Thank you!

Ludo’.

  parent reply	other threads:[~2017-02-08 15:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07  7:36 [PATCH 2/2] import: Add stackage importer and updater Federico Beffa
2017-02-08 13:19 ` Federico Beffa
2017-02-08 15:30 ` Ludovic Courtès [this message]
2017-02-09 18:39   ` Federico Beffa
2017-02-09 22:48     ` Ludovic Courtès

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=877f50og30.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=beffa@ieee.org \
    --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.