import: go: Handle extra whitespace in "go-import" meta tags.

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'.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Sarah Morgensen 2021-09-28 19:49:58 -07:00 committed by Ludovic Courtès
parent f666b9b478
commit ac43ead774
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -474,7 +474,7 @@ (define (fetch-module-meta-data module-path)
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)))))