unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip McGrath <philip@philipmcgrath.com>
To: 58621@debbugs.gnu.org
Cc: Philip McGrath <philip@philipmcgrath.com>
Subject: [bug#58621] [PATCH 1/3] import/utils: spdx-string->license: Fix incorrect docstring.
Date: Wed, 19 Oct 2022 01:04:47 -0400	[thread overview]
Message-ID: <f1221f03600ae3cd685a43944e1dea19f7f5fb33.1666146461.git.philip@philipmcgrath.com> (raw)
In-Reply-To: <cover.1666146461.git.philip@philipmcgrath.com>

The result of 'spdx-string->license' is a symbol, not a license object.

* guix/import/utils.scm (spdx-string->license): Fix docstring.
(license->symbol): Mention 'license:' prefix in docstring.
---
 guix/import/utils.scm | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/guix/import/utils.scm b/guix/import/utils.scm
index 5420037d1d..6afb009a00 100644
--- a/guix/import/utils.scm
+++ b/guix/import/utils.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
 ;;; Copyright © 2022 Alice Brenon <alice.brenon@ens-lyon.fr>
 ;;; Copyright © 2022 Kyle Meyer <kyle@kyleam.com>
+;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -131,8 +132,9 @@ (define (guix-hash-url filename)
   (bytevector->nix-base32-string (file-sha256 filename)))
 
 (define (spdx-string->license str)
-  "Convert STR, a SPDX formatted license identifier, to a license object.
-   Return #f if STR does not match any known identifiers."
+  "Convert STR, an SPDX license identifier, to a symbol like 'license:gpl3+
+giving the prefixed name of a license object exported from (guix licenses).
+Return #f if STR does not match any known SPDX license identifiers."
   ;; https://spdx.org/licenses/
   ;; The gfl1.0, nmap, repoze
   ;; licenses doesn't have SPDX identifiers
@@ -257,8 +259,9 @@ (define (spdx-string->license str)
     (_ #f)))
 
 (define (license->symbol license)
-  "Convert license to a symbol representing the variable the object is bound
-to in the (guix licenses) module, or #f if there is no such known license."
+  "Convert LICENSE object to a prefixed symbol representing the variable the
+object is bound to in the (guix licenses) module, such as 'license:gpl3+, or
+#f if there is no such known license."
   (define licenses
     (module-map (lambda (sym var) `(,(variable-ref var) . ,sym))
                 (resolve-interface '(guix licenses) #:prefix 'license:)))
-- 
2.38.0





  reply	other threads:[~2022-10-19  5:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  4:55 [bug#58621] [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support '+' operator Philip McGrath
2022-10-19  5:04 ` Philip McGrath [this message]
2022-10-19  5:04 ` [bug#58621] [PATCH 2/3] import/utils: spdx-string->license: Match case-insensitively Philip McGrath
2022-10-19  5:04 ` [bug#58621] [PATCH 3/3] import/utils: spdx-string->license: Support '+' operator Philip McGrath
2022-11-18 13:45   ` bug#58621: [PATCH 0/3] import/utils: spdx-string->license: Match case-insensitively and support " Ludovic Courtès
2022-11-18 20:21     ` [bug#58621] " Philip McGrath
2022-11-20 10:49       ` 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=f1221f03600ae3cd685a43944e1dea19f7f5fb33.1666146461.git.philip@philipmcgrath.com \
    --to=philip@philipmcgrath.com \
    --cc=58621@debbugs.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).