From e8a67f0fc4f7274d2447ac247df60b69d98e1b4e Mon Sep 17 00:00:00 2001 From: Sarah Morgensen Date: Mon, 30 Aug 2021 19:05:19 -0700 Subject: import: go: Fix import when import path redirects. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/import/go.scm (fetch-module-meta-data): If no meta entries have a matching import prefix, return the first entry instead of #f. Signed-off-by: Ludovic Courtès --- guix/import/go.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guix/import/go.scm b/guix/import/go.scm index 4755571209..c6ecdbaffd 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -485,9 +485,12 @@ build a package." (match (select (html->sxml meta-data #:strict? #t)) (() #f) ;nothing selected ((('content content-text) ..1) - (find (lambda (meta) - (string-prefix? (module-meta-import-prefix meta) module-path)) - (map go-import->module-meta content-text)))))) + (or + (find (lambda (meta) + (string-prefix? (module-meta-import-prefix meta) module-path)) + (map go-import->module-meta content-text)) + ;; Fallback to the first meta if no import prefixes match. + (go-import->module-meta (first content-text))))))) (define (module-meta-data-repo-url meta-data goproxy) "Return the URL where the fetcher which will be used can download the -- cgit v1.2.3