guix-patches
[Top][All Lists]
Advanced

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

[bug#37927] [bug#37928] [PATCH] import: crate: Fix licenses.


From: Ludovic Courtès
Subject: [bug#37927] [bug#37928] [PATCH] import: crate: Fix licenses.
Date: Sat, 16 Nov 2019 17:37:09 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux)

Hi Brice,

Did you have a chance to look into this?

(See <https://issues.guix.gnu.org/issue/37927> for context.)

Thanks in advance.  :-)
Ludo’.

Ludovic Courtès <address@hidden> skribis:

> Hi Brice,
>
> Brice Waegeneire <address@hidden> skribis:
>
>> * guix/import/crate.scm (%dual-license-rx): Removed function.
>> (crate->guix-package): Handle most of the multi-licensing cases.
>
> Nice!
>
>>  (define* (crate->guix-package crate-name #:optional version)
>>    "Fetch the metadata for CRATE-NAME from crates.io, and return the
>>  `package' s-expression corresponding to that package, or #f on failure.
>>  When VERSION is specified, attempt to fetch that version; otherwise fetch 
>> the
>>  latest version of CRATE-NAME."
>>    (define (string->license string)
>> -    (match (regexp-exec %dual-license-rx string)
>> -      (#f (list (spdx-string->license string)))
>> -      (m  (list (spdx-string->license (match:substring m 1))
>> -                (spdx-string->license (match:substring m 2))))))
>> +    (filter
>> +     (lambda (word)
>> +       (and (not (string-null? word))
>> +            (not (any (lambda (elem) (string=? elem word))
>> +                      '("AND" "OR" "WITH"))) ))
>> +     (string-split string (string->char-set " /"))))
>
> It would be great to have tests for that in tests/crate.scm.  To that
> end, I think you could lift ‘string->license’ to the top level (that is,
> outside ‘crate->guix-package’), and then have a few tests along these
> lines:
>
>   (define string->license
>     (@@ (guix import crate) string->license))
>
>   (test-equal "GPL OR LGPL"
>     (list license:gpl3+ license:lgpl3+)
>     (string->license "GPL OR LGPL"))
>
> (See
> <https://guix.gnu.org/manual/en/html_node/Running-the-Test-Suite.html>.)
>
> Let me know if anything is unclear.
>
> Could you send an updated patch?
>
> Thanks,
> Ludo’.





reply via email to

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