guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] import: Add stackage importer and updater.


From: Federico Beffa
Subject: Re: [PATCH 2/2] import: Add stackage importer and updater.
Date: Thu, 9 Feb 2017 19:39:15 +0100

On Wed, Feb 8, 2017 at 4:30 PM, Ludovic Courtès <address@hidden> wrote:
> Hello Federico,
>
> Federico Beffa <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]