import: go: Match "go-import" meta tags anywhere.
Some personal sites forget to put <meta name="go-import" ...> in a <head> element, so look anywhere for them. Partly fixes <https://issues.guix.gnu.org/50595>. Reported by Stephen Paul Weber <singpolyma@singpolyma.net>. * guix/import/go.scm (fetch-module-meta-data): Match "go-import" meta tags anywhere in the page. Signed-off-by: Ludovic Courtès <ludo@gnu.org>master
parent
b3907e304d
commit
281ede2e7d
|
@ -480,7 +480,7 @@ build a package."
|
||||||
(strip-.git-suffix/maybe repo-url)))))
|
(strip-.git-suffix/maybe repo-url)))))
|
||||||
;; <meta name="go-import" content="import-prefix vcs repo-root">
|
;; <meta name="go-import" content="import-prefix vcs repo-root">
|
||||||
(let* ((meta-data (http-fetch* (format #f "https://~a?go-get=1" module-path)))
|
(let* ((meta-data (http-fetch* (format #f "https://~a?go-get=1" module-path)))
|
||||||
(select (sxpath `(// head (meta (@ (equal? (name "go-import"))))
|
(select (sxpath `(// (meta (@ (equal? (name "go-import"))))
|
||||||
// content))))
|
// content))))
|
||||||
(match (select (html->sxml meta-data #:strict? #t))
|
(match (select (html->sxml meta-data #:strict? #t))
|
||||||
(() #f) ;nothing selected
|
(() #f) ;nothing selected
|
||||||
|
|
Reference in New Issue