diff mbox series

[bug#50884] import: go: Handle extra whitespace in "go-import" meta tags.

Message ID a17a80cb6c49792d27f09817e484461bb190c9d3.1632883770.git.iskarian@mgsn.dev
State Accepted
Headers show
Series [bug#50884] import: go: Handle extra whitespace in "go-import" meta tags. | expand

Checks

Context Check Description
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue
cbaines/applying patch fail View Laminar job
cbaines/issue success View issue

Commit Message

Sarah Morgensen Sept. 29, 2021, 2:49 a.m. UTC
Some packages sites use extra whitespace in the content portion of <meta
name="go-import" ...> tags, so handle that.  Example:
<https://k8s.io/api?go-get=1>

* guix/import/go.scm (fetch-module-meta-data)[go-import->module-meta]:
Use 'string-tokenize' instead of 'string-split'.
---
 guix/import/go.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: c582be4c38596a6a31a39c6799723dcd8b6eb909

Comments

Ludovic Courtès Oct. 4, 2021, 2:07 p.m. UTC | #1
Sarah Morgensen <iskarian@mgsn.dev> skribis:

> Some packages sites use extra whitespace in the content portion of <meta
> name="go-import" ...> tags, so handle that.  Example:
> <https://k8s.io/api?go-get=1>
>
> * guix/import/go.scm (fetch-module-meta-data)[go-import->module-meta]:
> Use 'string-tokenize' instead of 'string-split'.

Applied, thanks!  Would it make sense to have a regression test?

Ludo’.
diff mbox series

Patch

diff --git a/guix/import/go.scm b/guix/import/go.scm
index 9769b557ae..ca909ab35a 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -474,7 +474,7 @@  Optionally include a VERSION string to append to the name."
 because goproxy servers don't currently provide all the information needed to
 build a package."
   (define (go-import->module-meta content-text)
-    (match (string-split content-text #\space)
+    (match (string-tokenize content-text char-set:graphic)
       ((root-path vcs repo-url)
        (make-module-meta root-path (string->symbol vcs)
                          (strip-.git-suffix/maybe repo-url)))))