diff options
author | Sarah Morgensen <iskarian@mgsn.dev> | 2021-08-30 19:05:19 -0700 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-09-07 15:59:35 +0200 |
commit | e8a67f0fc4f7274d2447ac247df60b69d98e1b4e (patch) | |
tree | 0779ec5038f87de2368547e75e7c91ba5ab98974 | |
parent | af4fa7c00cae47552486c28d5559c53e058b597f (diff) | |
download | guix-e8a67f0fc4f7274d2447ac247df60b69d98e1b4e.tar.gz guix-e8a67f0fc4f7274d2447ac247df60b69d98e1b4e.zip |
import: go: Fix import when import path redirects.
* 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 <ludo@gnu.org>
-rw-r--r-- | guix/import/go.scm | 9 |
1 files 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 |