GNU bug report logs - #32933
[PATCH] guix: add license prefix hackage imports

Previous Next

Package: guix-patches;

Reported by: Joe Hillenbrand <joehillen <at> gmail.com>

Date: Thu, 4 Oct 2018 16:19:03 UTC

Severity: normal

Tags: patch

Done: Xinglu Chen <public <at> yoctocell.xyz>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32933 in the body.
You can then email your comments to 32933 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Thu, 04 Oct 2018 16:19:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Joe Hillenbrand <joehillen <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 04 Oct 2018 16:19:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Joe Hillenbrand <joehillen <at> gmail.com>
To: guix-patches <at> gnu.org
Subject: [PATCH] guix: add license prefix hackage imports
Date: Thu, 4 Oct 2018 09:17:23 -0700
---
 guix/import/hackage.scm | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
index 766a0b53f..8f4a46534 100644
--- a/guix/import/hackage.scm
+++ b/guix/import/hackage.scm
@@ -35,6 +35,7 @@
   #:use-module (guix store)
   #:use-module (gcrypt hash)
   #:use-module (guix base32)
+  #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix memoization)
   #:use-module (guix upstream)
   #:use-module (guix packages)
@@ -135,20 +136,21 @@ version."
   ;; https://www.haskell.org
   ;; /cabal/release/cabal-latest/doc/API/Cabal/Distribution-License.html.
   (match-lambda
-   ("GPL-2" 'gpl2)
-   ("GPL-3" 'gpl3)
-   ("GPL" "'gpl??")
-   ("AGPL-3" 'agpl3)
-   ("AGPL" "'agpl??")
-   ("LGPL-2.1" 'lgpl2.1)
-   ("LGPL-3" 'lgpl3)
-   ("LGPL" "'lgpl??")
-   ("BSD2" 'bsd-2)
-   ("BSD3" 'bsd-3)
-   ("MIT" 'expat)
-   ("ISC" 'isc)
-   ("MPL" 'mpl2.0)
-   ("Apache-2.0" 'asl2.0)
+   ("GPL-2" 'license:gpl2)
+   ("GPL-3" 'license:gpl3)
+   ("GPL" 'license:gpl??)
+   ("AGPL-3" 'license:agpl3)
+   ("AGPL" 'license:agpl)
+   ("LGPL-2.0" 'license:lgpl2.0)
+   ("LGPL-2.1" 'license:lgpl2.1)
+   ("LGPL-3" 'license:lgpl3)
+   ("LGPL" 'license:lgpl??)
+   ("BSD2" 'license:bsd-2)
+   ("BSD3" 'license:bsd-3)
+   ("MIT" 'license:expat)
+   ("ISC" 'license:isc)
+   ("MPL" 'license:mpl2.0)
+   ("Apache-2.0" 'license:asl2.0)
    ((x) (string->license x))
    ((lst ...) `(list ,@(map string->license lst)))
    (_ #f)))
--
2.19.0




Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Fri, 12 Oct 2018 13:18:01 GMT) Full text and rfc822 format available.

Message #8 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Joe Hillenbrand <joehillen <at> gmail.com>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 32933 <at> debbugs.gnu.org
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Fri, 12 Oct 2018 15:17:32 +0200
Hi Joe,

Joe Hillenbrand <joehillen <at> gmail.com> skribis:

> ---
>  guix/import/hackage.scm | 30 ++++++++++++++++--------------
>  1 file changed, 16 insertions(+), 14 deletions(-)
>
> diff --git a/guix/import/hackage.scm b/guix/import/hackage.scm
> index 766a0b53f..8f4a46534 100644

[...]

> +   ("GPL-2" 'license:gpl2)

No strong opinion, but apparently none of the importers currently adds
the ‘license:’ prefix and I’d rather keep that consistent, one way or
another.

Ricardo, WDYT?

Thanks for the patch!

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Fri, 12 Oct 2018 17:57:01 GMT) Full text and rfc822 format available.

Message #11 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: Joe Hillenbrand <joehillen <at> gmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: rekado <at> elephly.net, 32933 <at> debbugs.gnu.org
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Fri, 12 Oct 2018 10:55:30 -0700
Sorry, I meant to add justification in the commit message, but apparently I
forgot.

The motivation was to be consistent with the `gnu/packages/haskell.scm` which
uses the `license:` prefix. I noticed this when I imported a bunch of packages
and all of them were missing the prefix, which then had to be manually added.

On Fri, Oct 12, 2018 at 6:17 AM Ludovic Courtès <ludo <at> gnu.org> wrote:
>
> No strong opinion, but apparently none of the importers currently adds
> the ‘license:’ prefix and I’d rather keep that consistent, one way or
> another.

That's not entirely true. crate calls `spdx-string->license` which adds the
prefix, but it doesn't appear to actually work because it looks for the license
in the wrong part of the json output from crates.io.

I'd be happy to add it to the other importers as it looks like almost all of
`gnu/packages/*.scm` has the `license:` prefix. If so, should I do them all
in a new patch?

Thanks,
Joe




Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Fri, 12 Oct 2018 20:32:01 GMT) Full text and rfc822 format available.

Message #14 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Joe Hillenbrand <joehillen <at> gmail.com>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 32933 <at> debbugs.gnu.org
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Fri, 12 Oct 2018 22:31:05 +0200
Hi Joe,

> The motivation was to be consistent with the `gnu/packages/haskell.scm` which
> uses the `license:` prefix. I noticed this when I imported a bunch of packages
> and all of them were missing the prefix, which then had to be manually added.
>
> On Fri, Oct 12, 2018 at 6:17 AM Ludovic Courtès <ludo <at> gnu.org> wrote:
>>
>> No strong opinion, but apparently none of the importers currently adds
>> the ‘license:’ prefix and I’d rather keep that consistent, one way or
>> another.
>
> That's not entirely true. crate calls `spdx-string->license` which adds the
> prefix, but it doesn't appear to actually work because it looks for the license
> in the wrong part of the json output from crates.io.

I have a slight preference to not adding the prefix.  It is true that
most modules do use this prefix, but I think the importers should be
agnostic of that.  Some modules don’t use this prefix (e.g. web.scm) or
no prefix at all (especially user modules that don’t exist yet).

I’d rather have the importers be more flexible and do the right thing
dependent on context, but I have no good idea how to accomplish this
considering that they are used outside of any context (unless they were
called as part of an updater).

--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Mon, 15 Oct 2018 08:08:01 GMT) Full text and rfc822 format available.

Message #17 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 32933 <at> debbugs.gnu.org, Joe Hillenbrand <joehillen <at> gmail.com>
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Mon, 15 Oct 2018 10:07:12 +0200
Hello,

Ricardo Wurmus <rekado <at> elephly.net> skribis:

>> The motivation was to be consistent with the `gnu/packages/haskell.scm` which
>> uses the `license:` prefix. I noticed this when I imported a bunch of packages
>> and all of them were missing the prefix, which then had to be manually added.
>>
>> On Fri, Oct 12, 2018 at 6:17 AM Ludovic Courtès <ludo <at> gnu.org> wrote:
>>>
>>> No strong opinion, but apparently none of the importers currently adds
>>> the ‘license:’ prefix and I’d rather keep that consistent, one way or
>>> another.
>>
>> That's not entirely true. crate calls `spdx-string->license` which adds the
>> prefix, but it doesn't appear to actually work because it looks for the license
>> in the wrong part of the json output from crates.io.
>
> I have a slight preference to not adding the prefix.  It is true that
> most modules do use this prefix, but I think the importers should be
> agnostic of that.  Some modules don’t use this prefix (e.g. web.scm) or
> no prefix at all (especially user modules that don’t exist yet).
>
> I’d rather have the importers be more flexible and do the right thing
> dependent on context, but I have no good idea how to accomplish this
> considering that they are used outside of any context (unless they were
> called as part of an updater).

Right, I sort of feel along the same lines.

OTOH, the goal of ‘guix import’ is to provide templates as close as
possible to working package definitions.  In that sense, if adding the
‘license:’ prefix lowers the barrier a little bit (and it certainly
does, as Joe wrote), the better.

For the sake of consistency though, it may be best to do it for all the
importers, if we were to take that route.

WDYT, Ricardo?

Thanks,
Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Mon, 15 Oct 2018 09:50:02 GMT) Full text and rfc822 format available.

Message #20 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 32933 <at> debbugs.gnu.org, Joe Hillenbrand <joehillen <at> gmail.com>
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Mon, 15 Oct 2018 11:47:34 +0200
Ludovic Courtès <ludo <at> gnu.org> writes:

> OTOH, the goal of ‘guix import’ is to provide templates as close as
> possible to working package definitions.  In that sense, if adding the
> ‘license:’ prefix lowers the barrier a little bit (and it certainly
> does, as Joe wrote), the better.
>
> For the sake of consistency though, it may be best to do it for all the
> importers, if we were to take that route.

Adding the same prefix to all importers sounds good to me.

--
Ricardo





Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Mon, 15 Oct 2018 13:43:02 GMT) Full text and rfc822 format available.

Message #23 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: Joe Hillenbrand <joehillen <at> gmail.com>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 32933 <at> debbugs.gnu.org
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Mon, 15 Oct 2018 06:42:36 -0700
[Message part 1 (text/plain, inline)]
On Mon, Oct 15, 2018, 02:49 Ricardo Wurmus <rekado <at> elephly.net> wrote:

>
> Ludovic Courtès <ludo <at> gnu.org> writes:
> >
> > For the sake of consistency though, it may be best to do it for all the
> > importers, if we were to take that route.
>
> Adding the same prefix to all importers sounds good to me.
>

Should I create a patch for each importer or do them all in one patch?

>
[Message part 2 (text/html, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#32933; Package guix-patches. (Mon, 15 Oct 2018 13:49:02 GMT) Full text and rfc822 format available.

Message #26 received at 32933 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Joe Hillenbrand <joehillen <at> gmail.com>
Cc: Ludovic Courtès <ludo <at> gnu.org>, 32933 <at> debbugs.gnu.org
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Mon, 15 Oct 2018 15:47:48 +0200
Joe Hillenbrand <joehillen <at> gmail.com> writes:

> On Mon, Oct 15, 2018, 02:49 Ricardo Wurmus <rekado <at> elephly.net> wrote:
>
>>
>> Ludovic Courtès <ludo <at> gnu.org> writes:
>> >
>> > For the sake of consistency though, it may be best to do it for all the
>> > importers, if we were to take that route.
>>
>> Adding the same prefix to all importers sounds good to me.
>>
>
> Should I create a patch for each importer or do them all in one patch?

Either way is fine.  If you create one patch for all importers please
make sure to list all the changes to the different files explicitly in
the commit summary.

Thank you!

--
Ricardo





Reply sent to Xinglu Chen <public <at> yoctocell.xyz>:
You have taken responsibility. (Tue, 21 Dec 2021 17:19:01 GMT) Full text and rfc822 format available.

Notification sent to Joe Hillenbrand <joehillen <at> gmail.com>:
bug acknowledged by developer. (Tue, 21 Dec 2021 17:19:02 GMT) Full text and rfc822 format available.

Message #31 received at 32933-done <at> debbugs.gnu.org (full text, mbox):

From: Xinglu Chen <public <at> yoctocell.xyz>
To: Joe Hillenbrand <joehillen <at> gmail.com>, 32933-done <at> debbugs.gnu.org
Subject: Re: [bug#32933] [PATCH] guix: add license prefix hackage imports
Date: Tue, 21 Dec 2021 18:18:26 +0100
[Message part 1 (text/plain, inline)]
This was done in commit cfec09a9928e171a724f630ba652ea0241d52e92.

Closing!
[signature.asc (application/pgp-signature, inline)]

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 19 Jan 2022 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 94 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.