importer opam: unsupported type in string-ci=?

  • Done
  • quality assurance status badge
Details
2 participants
  • Josselin Poiret
  • Simon Tournier
Owner
unassigned
Submitted by
Simon Tournier
Severity
normal
S
S
Simon Tournier wrote on 11 Oct 2023 11:06
(address . bug-guix@gnu.org)
86h6mxle91.fsf@gmail.com
Hi,

Using Guix 6113e05, I get this error:

Toggle snippet (28 lines)
$ guix import opam odig

Starting download of /tmp/guix-file.Yahnl4
From https://erratique.ch/software/odig/releases/odig-0.0.9.tbz...
odig-0.0.9.tbz 11.2MiB 550KiB/s 00:21 ???????????????????? 100.0%
Backtrace:
8 (primitive-load "/home/simon/.config/guix/current/bin/guix")
In guix/ui.scm:
2323:7 7 (run-guix . _)
2286:10 6 (run-guix-command _ . _)
In guix/scripts/import.scm:
90:11 5 (guix-import . _)
In guix/scripts/import/opam.scm:
105:24 4 (guix-import-opam . _)
In guix/import/opam.scm:
382:24 3 (opam->guix-package _ #:repo _ #:version _)
In guix/import/utils.scm:
300:2 2 (spdx-string->license ((string-pat "ISC") (string-pat "LicenseRef-ParaType-Free-Font-License") (# …)))
In srfi/srfi-1.scm:
939:17 1 (assoc ((string-pat "ISC") (string-pat "LicenseRef-ParaType-Free-Font-License") (string-pat "Li…")) _ …)
In unknown file:
0 (string-ci=? ((string-pat "ISC") (string-pat "LicenseRef-ParaType-Free-Font-License") (# "Licen…")) #)

ERROR: In procedure string-ci=?:
In procedure string-ci=: Wrong type argument in position 1 (expecting string): ((string-pat "ISC") (string-pat "LicenseRef-ParaType-Free-Font-License") (string-pat "LicenseRef-DejaVu-fonts"))


Cheers,
simon
J
J
Josselin Poiret wrote on 15 Oct 2023 11:38
[PATCH] guix: import: opam: Handle list of licenses.
(name . Josselin Poiret)(address . dev@jpoiret.xyz)
db0ce9de82c59c6bb16826c2ed1d7d3bb56a51d2.1697362698.git.dev@jpoiret.xyz
From: Josselin Poiret <dev@jpoiret.xyz>

* guix/import/opam.scm (opam->guix-package): Handle lists of licenses.
---
Hello Simon,

Here's a quick fix.

Best,
Josselin

guix/import/opam.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (21 lines)
diff --git a/guix/import/opam.scm b/guix/import/opam.scm
index e67146e593..86e82cde59 100644
--- a/guix/import/opam.scm
+++ b/guix/import/opam.scm
@@ -379,8 +379,10 @@ (define* (opam->guix-package name #:key (repo '("opam")) version #:allow-other-k
(synopsis ,(metadata-ref opam-content "synopsis"))
(description ,(and=> (metadata-ref opam-content "description")
beautify-description))
- (license ,(spdx-string->license
- (metadata-ref opam-content "license"))))
+ (license ,(match (metadata-ref opam-content "license")
+ ((('string-pat strs) ...)
+ `(list ,@(map spdx-string->license strs)))
+ ((? string? str) (spdx-string->license str)))))
(filter
(lambda (name)
(not (member name '("dune" "jbuilder"))))

base-commit: d2923babf3ac44cb6faa88317f77c98f3016820d
--
2.41.0
S
S
Simon Tournier wrote on 17 Oct 2023 14:56
(name . Josselin Poiret)(address . dev@jpoiret.xyz)(address . 66461-done@debbugs.gnu.org)
CAJ3okZ3kTh0ObqROH0ueb_+38=pMBto2=00FM+zjAFo-wqEL3g@mail.gmail.com
Hi Josselin,

Cool, thank you for the quick fix.

On Sun, 15 Oct 2023 at 11:39, Josselin Poiret <dev@jpoiret.xyz> wrote:

Toggle quote (5 lines)
> * guix/import/opam.scm (opam->guix-package): Handle lists of licenses.
> ---
> guix/import/opam.scm | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)

LGTM. Pushed and closing.

Cheers,
simon
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 66461@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 66461
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch