aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2021-04-22 11:43:50 +0200
committerLudovic Courtès <ludo@gnu.org>2021-04-23 00:32:30 +0200
commit55e90e555857afdcca90b42115b9de8539e4f4ac (patch)
treea16c60098650b8943cf3e414f592206f3fcc91d2
parentc22204cf7bf12056c43e5da2fd99c95866143ddc (diff)
downloadguix-55e90e555857afdcca90b42115b9de8539e4f4ac.tar.gz
guix-55e90e555857afdcca90b42115b9de8539e4f4ac.zip
import: go: Do not set '%strict-tokenizer?' from the top level.
This avoids interference with other users of (htmlprag) and makes the intent clearer. * guix/import/go.scm <top level>: Remove call to '%strict-tokenizer?'. (go-package-licenses, go-package-description) (go-package-synopsis, fetch-module-meta-data): Pass #:strict? #t to 'html->sxml'.
-rw-r--r--guix/import/go.scm11
1 files changed, 4 insertions, 7 deletions
diff --git a/guix/import/go.scm b/guix/import/go.scm
index bc53f8f558..71f2316719 100644
--- a/guix/import/go.scm
+++ b/guix/import/go.scm
@@ -63,9 +63,6 @@
#:export (go-module->guix-package
go-module-recursive-import))
-;;; Parameterize htmlprag to parse valid HTML more reliably.
-(%strict-tokenizer? #t)
-
;;; Commentary:
;;;
;;; (guix import go) attempts to make it easier to create Guix package
@@ -149,7 +146,7 @@ name (e.g. \"github.com/golang/protobuf/proto\")."
;; element marked with a "License" class attribute.
(select (sxpath `(// (* (@ (equal? (class "License"))))
h2 // *text*))))
- (select (html->sxml body))))
+ (select (html->sxml body #:strict? #t))))
(define (sxml->texi sxml-node)
"A very basic SXML to Texinfo converter which attempts to preserve HTML
@@ -167,7 +164,7 @@ formatting and links as text."
"Retrieve a short description for NAME, a Go package name,
e.g. \"google.golang.org/protobuf/proto\"."
(let* ((body (go.pkg.dev-info name))
- (sxml (html->sxml body))
+ (sxml (html->sxml body #:strict? #t))
(overview ((sxpath
`(//
(* (@ (equal? (class "Documentation-overview"))))
@@ -209,7 +206,7 @@ the https://pkg.go.dev/ web site."
(select-title (sxpath
`(// (div (@ (equal? (class "UnitReadme-content"))))
// h3 *text*))))
- (match (select-title (html->sxml body))
+ (match (select-title (html->sxml body #:strict? #t))
(() #f) ;nothing selected
((title more ...) ;title is the first string of the list
(string-trim-both title)))))
@@ -465,7 +462,7 @@ build a package."
(let* ((meta-data (http-fetch* (format #f "https://~a?go-get=1" module-path)))
(select (sxpath `(// head (meta (@ (equal? (name "go-import"))))
// content))))
- (match (select (html->sxml meta-data))
+ (match (select (html->sxml meta-data #:strict? #t))
(() #f) ;nothing selected
(((content content-text))
(match (string-split content-text #\space)