guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

05/07: import: go: Fix import when import path redirects.


From: guix-commits
Subject: 05/07: import: go: Fix import when import path redirects.
Date: Tue, 7 Sep 2021 10:09:30 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit e8a67f0fc4f7274d2447ac247df60b69d98e1b4e
Author: Sarah Morgensen <iskarian@mgsn.dev>
AuthorDate: Mon Aug 30 19:05:19 2021 -0700

    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>
---
 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 4755571..c6ecdba 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]