guix-patches
[Top][All Lists]
Advanced

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

[bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'licens


From: Ludovic Courtès
Subject: [bug#58231] [PATCH 2/2] packages: Raise an exception for invalid 'license' values.
Date: Mon, 10 Oct 2022 16:52:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Hi,

zimoun <zimon.toutoune@gmail.com> skribis:

> On sam., 01 oct. 2022 at 18:20, Ludovic Courtès <ludo@gnu.org> wrote:
>
>>  ;; A package.
>>  (define-record-type* <package>
>>    package make-package
>> @@ -574,7 +607,8 @@ (define-record-type* <package>
>>              (sanitize validate-texinfo))          ; one-line description
>>    (description package-description
>>                 (sanitize validate-texinfo))       ; one or two paragraphs
>> -  (license package-license)                       ; (list of) <license>
>> +  (license package-license                        ; (list of) <license>
>> +           (sanitize validate-license))
>>    (home-page package-home-page)
>>    (supported-systems package-supported-systems    ; list of strings
>>                       (default %supported-systems))
>
> This change is the core, IIUC.  The question is: does it make sense to
> have something similar for all the fields?
>
> For instance, the fields ’name’ and ’verson’ are expected to be ’string’
> and could be similarly checked?

I think eventually we should have contracts rather than home-made type
checks like this (Cc’ing Philip).

However, as you write, we have to pay attention to performance in the
case of packages as it could quickly become too expensive.  While I
think it could make sense to have contracts for all the fields of
service configuration records, I think we’ll have to do much less for
<package> fields.

Ludo’.





reply via email to

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