me
/
guix
Archived
1
0
Fork 0

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>
master
Sarah Morgensen 2021-08-30 19:05:19 -07:00 committed by Ludovic Courtès
parent af4fa7c00c
commit e8a67f0fc4
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
1 changed files with 6 additions and 3 deletions

View File

@ -485,9 +485,12 @@ build a package."
(match (select (html->sxml meta-data #:strict? #t)) (match (select (html->sxml meta-data #:strict? #t))
(() #f) ;nothing selected (() #f) ;nothing selected
((('content content-text) ..1) ((('content content-text) ..1)
(find (lambda (meta) (or
(string-prefix? (module-meta-import-prefix meta) module-path)) (find (lambda (meta)
(map go-import->module-meta content-text)))))) (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) (define (module-meta-data-repo-url meta-data goproxy)
"Return the URL where the fetcher which will be used can download the "Return the URL where the fetcher which will be used can download the