unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Federico Beffa <beffa@ieee.org>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH 2/2] import: Add stackage importer and updater.
Date: Thu, 9 Feb 2017 19:39:15 +0100	[thread overview]
Message-ID: <CAKrPhPNS+HjmGb7_Rz8Axnc0ZB0103NMkA3ingTwhadfRgbjNg@mail.gmail.com> (raw)
In-Reply-To: <877f50og30.fsf@gnu.org>

On Wed, Feb 8, 2017 at 4:30 PM, Ludovic Courtès <ludo@gnu.org> wrote:
> Hello Federico,
>
> Federico Beffa <beffa@ieee.org> skribis:

> [...]

>> +    (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.

I've implemented all suggested changes apart from this one for two reasons:

* If the package is not included in an LTS release then the procedure
generating name-version returns #f. If I remove the 'if' then
hackage->guix-package will be called with a boolean instead of a
string as the first parameter and that will throw an exception.

* Here we can give a more accurate error message: we can say that the
package was not found in the LTS release, while, by returning, the
error would be "failed to download cabal file" which is somewhat
misleading.

Thanks for the review.
Fede

  reply	other threads:[~2017-02-09 18:39 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
2017-02-09 18:39   ` Federico Beffa [this message]
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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=CAKrPhPNS+HjmGb7_Rz8Axnc0ZB0103NMkA3ingTwhadfRgbjNg@mail.gmail.com \
    --to=beffa@ieee.org \
    --cc=guix-devel@gnu.org \
    --cc=ludo@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).