From patchwork Tue May 3 11:42:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Attila Lendvai X-Patchwork-Id: 39095 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 8EC9D27BBEA; Tue, 3 May 2022 12:44:33 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 48B6C27BBE9 for ; Tue, 3 May 2022 12:44:33 +0100 (BST) Received: from localhost ([::1]:45608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlqxE-0003eA-ER for patchwork@mira.cbaines.net; Tue, 03 May 2022 07:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38588) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlqwk-0003dC-Ng for guix-patches@gnu.org; Tue, 03 May 2022 07:44:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:44940) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlqwk-0002RD-DO for guix-patches@gnu.org; Tue, 03 May 2022 07:44:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlqwk-0005Pq-Bg for guix-patches@gnu.org; Tue, 03 May 2022 07:44:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55242] [PATCH 02/10] guix: import: go: Rename go.pkg.dev-info to pkg.go.dev-info. References: <20220503111620.3139-1-attila@lendvai.name> In-Reply-To: <20220503111620.3139-1-attila@lendvai.name> Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 May 2022 11:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55242 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 55242@debbugs.gnu.org Cc: Attila Lendvai Received: via spool by 55242-submit@debbugs.gnu.org id=B55242.165157821020687 (code B ref 55242); Tue, 03 May 2022 11:44:02 +0000 Received: (at 55242) by debbugs.gnu.org; 3 May 2022 11:43:30 +0000 Received: from localhost ([127.0.0.1]:38815 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlqwE-0005NZ-Ch for submit@debbugs.gnu.org; Tue, 03 May 2022 07:43:30 -0400 Received: from mail-ed1-f48.google.com ([209.85.208.48]:42843) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlqwB-0005N3-Lc for 55242@debbugs.gnu.org; Tue, 03 May 2022 07:43:28 -0400 Received: by mail-ed1-f48.google.com with SMTP id z19so19494210edx.9 for <55242@debbugs.gnu.org>; Tue, 03 May 2022 04:43:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=0EaRwqltx74K+c88sp3dmDjNsW9WweZYaKkVLmJrrW4=; b=orYLiFZdh+iZfTVRl84FOWB5McxY83Y5/H/LdojRJPpM3HE/NikzefKISFVzYEkICP /YpUNxgxh8bWJV/SRJrsVOjvXLYCZYktCbaZwzRHk1ct0pBqZgdCGpzH+rpi4cSsJnHw /43yW94MtR+dOXfQn6r8Dt0s2AuBXAcZ5N+m7HFy9zmiC5iN76mQ15Qly6zSZSyP34P6 p7uR02nWz3WZdDfoKCT5ItDO6mFx6h10+swqHs0DnrN7d4k6epRwnUY0T4ynF776MEzW 69V8KlO2QOucSZGaPS5XdMg+AKkiFlI+dnVWaIm2tclAo56pD2pO7+byICpZO2d2lVZO x1NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=0EaRwqltx74K+c88sp3dmDjNsW9WweZYaKkVLmJrrW4=; b=IP6bxWBo9g4IFRF7v0gHQi5xbi3l65VMGfz0VPVnhcVkDSYpF7C7cXQ2XHwHj/Zm7R C0B/GuBpeKu6E8Qb6CX1zwz6AkrSS8xXhdf2hNbrEbBOvYA5i+F5kvsKsNFsgc2Q8uae Q0juYhKmQfO59oVLnhBg8iLNF7AxegFNgatcFDMEgJGJf7pSOevHmnmhIm9Me+iif/E3 kE/lE7JV1W6L8+ojUkIuvKFuSVPbSDQY9aVxLLdBtCm3nUdRytG91ImFppbexjWHA8n8 v/H+jcLpgAMz0nJo1y13jX3GySJl5iTtfNK4TR1Kjx08Y1+PxlEEUVT3UIpxmagRGAd2 XvZA== X-Gm-Message-State: AOAM5301/Hm4E5oo6f13WuXsAHQqbM+Ti17bqyfaKiYPYFG+oSp56qON 5JQHbVLO1TmBXeOhmKO3ts1RbGd07A0= X-Google-Smtp-Source: ABdhPJyF019NFblk2hic2vsFhwlOHyhy4Qq7jZyCjz96xo4tvymMgRihoaC6DWNAF37YeKVZC6TJDQ== X-Received: by 2002:aa7:d549:0:b0:425:fc06:60d4 with SMTP id u9-20020aa7d549000000b00425fc0660d4mr17902490edr.300.1651578201541; Tue, 03 May 2022 04:43:21 -0700 (PDT) Received: from lelap.local (catv-89-132-245-188.catv.fixed.vodafone.hu. [89.132.245.188]) by smtp.gmail.com with ESMTPSA id k13-20020a05640212cd00b0042617ba63d6sm7766964edx.96.2022.05.03.04.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 May 2022 04:43:21 -0700 (PDT) From: Attila Lendvai Date: Tue, 3 May 2022 13:42:53 +0200 Message-Id: <20220503114301.9524-2-attila@lendvai.name> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches To properly mimic the name of the website. Also employ it at one more place. --- guix/import/go.scm | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/guix/import/go.scm b/guix/import/go.scm index d00c13475a..bb4bb7bb7b 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -120,8 +120,11 @@ (define (escape occurrence) ;; Prevent inlining of this procedure, which is accessed by unit tests. (set! go-path-escape go-path-escape) -(define (go.pkg.dev-info name) - (http-fetch* (string-append "https://pkg.go.dev/" name))) +(define (pkg.go.dev-info module-path) + ;; FIXME if MODULE-PATH is a fork on github, then it will try to get the + ;; info of the fork (instead of the upstream), which most probably does not + ;; exist in pkg.go.dev. Example: https://github.com/bonitoo-io/oapi-codegen + (http-fetch* (string-append "https://pkg.go.dev/" module-path))) (define* (go-module-version-string goproxy name #:key version) "Fetch the version string of the latest version for NAME from the given @@ -147,7 +150,7 @@ (define* (go-module-available-versions goproxy name) (define (go-package-licenses name) "Retrieve the list of licenses that apply to NAME, a Go package or module name (e.g. \"github.com/golang/protobuf/proto\")." - (let* ((body (go.pkg.dev-info (string-append name "?tab=licenses"))) + (let* ((body (pkg.go.dev-info (string-append name "?tab=licenses"))) ;; Extract the text contained in a h2 child node of any ;; element marked with a "License" class attribute. (select (sxpath `(// (* (@ (equal? (class "License")))) @@ -169,7 +172,7 @@ (define (sxml->texi sxml-node) (define (go-package-description name) "Retrieve a short description for NAME, a Go package name, e.g. \"google.golang.org/protobuf/proto\"." - (let* ((body (go.pkg.dev-info name)) + (let* ((body (pkg.go.dev-info name)) (sxml (html->sxml body #:strict? #t)) (overview ((sxpath `(// @@ -206,8 +209,7 @@ (define (go-package-synopsis module-name) the https://pkg.go.dev/ web site." ;; Note: Only the *module* (rather than package) page has the README title ;; used as a synopsis on the https://pkg.go.dev web site. - (let* ((url (string-append "https://pkg.go.dev/" module-name)) - (body (http-fetch* url)) + (let* ((body (pkg.go.dev-info module-name)) ;; Extract the text contained in a h2 child node of any ;; element marked with a "License" class attribute. (select-title (sxpath