From patchwork Wed Sep 29 02:59:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarah Morgensen X-Patchwork-Id: 33414 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 E803127BBE3; Wed, 29 Sep 2021 04:14:03 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B0C2027BBE1 for ; Wed, 29 Sep 2021 04:14:03 +0100 (BST) Received: from localhost ([::1]:59254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mVQ2k-0001cl-JU for patchwork@mira.cbaines.net; Tue, 28 Sep 2021 23:14:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60982) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVPpC-0007YB-F0 for guix-patches@gnu.org; Tue, 28 Sep 2021 23:00:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mVPpC-00071n-60 for guix-patches@gnu.org; Tue, 28 Sep 2021 23:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mVPpC-0000WD-0V for guix-patches@gnu.org; Tue, 28 Sep 2021 23:00:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50885] [PATCH] import: go: Recognize major version suffixes. Resent-From: Sarah Morgensen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 29 Sep 2021 03:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50885 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50885@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16328843811933 (code B ref -1); Wed, 29 Sep 2021 03:00:01 +0000 Received: (at submit) by debbugs.gnu.org; 29 Sep 2021 02:59:41 +0000 Received: from localhost ([127.0.0.1]:47421 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVPoq-0000V7-RZ for submit@debbugs.gnu.org; Tue, 28 Sep 2021 22:59:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:50540) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mVPop-0000V0-6U for submit@debbugs.gnu.org; Tue, 28 Sep 2021 22:59:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVPoo-00076A-S4 for guix-patches@gnu.org; Tue, 28 Sep 2021 22:59:38 -0400 Received: from out2.migadu.com ([2001:41d0:2:aacc::]:60074) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mVPom-0006gb-ST for guix-patches@gnu.org; Tue, 28 Sep 2021 22:59:38 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mgsn.dev; s=key1; t=1632884374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=SwKrTP+s2M1J40z1LKwymzMrvBkV2DcLPAxt5kj7YrE=; b=L2Slh5rQhqWyYSDBbb0OyarQLN1SYc4WT8TxWSiE1Xrsi1zw9N5I3uY32eY0qWdZ4yrT7W x0pRtWV+NqpUJlOEXx+9L/9qULbVco1uLlsVmOh6PnCMdfHaN0cJMCu+/1KgNI/1SpPare 8ALsC9Gu6+5Gtr8ZAqYlziSE+YbhocM= From: Sarah Morgensen Date: Tue, 28 Sep 2021 19:59:32 -0700 Message-Id: <58c2e5ecbfef887de1414a4fed38634b0ed6c259.1632884296.git.iskarian@mgsn.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: iskarian@mgsn.dev Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=iskarian@mgsn.dev; helo=out2.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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 Do not treat major version suffixes (such as "/v3") as repository subdirectories. See . * guix/import/go.scm (go-module->guix-package): When determining the unpack path, compare 'root-module-path' to 'module-path-sans-suffix' instead of 'module-path'. --- guix/import/go.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) base-commit: c582be4c38596a6a31a39c6799723dcd8b6eb909 prerequisite-patch-id: dbb8a05982f57aefffd5b97ab3dac4073b48245d diff --git a/guix/import/go.scm b/guix/import/go.scm index ca909ab35a..26dbc34b63 100644 --- a/guix/import/go.scm +++ b/guix/import/go.scm @@ -612,6 +612,8 @@ hint: use one of the following available versions ~a\n" (dependencies (if pin-versions? dependencies+versions (map car dependencies+versions))) + (module-path-sans-suffix + (match:prefix (string-match "([\\./]v[0-9]+)?$" module-path))) (guix-name (go-module->guix-package-name module-path)) (root-module-path (module-path->repository-root module-path)) ;; The VCS type and URL are not included in goproxy information. For @@ -631,7 +633,7 @@ hint: use one of the following available versions ~a\n" (build-system go-build-system) (arguments '(#:import-path ,module-path - ,@(if (string=? module-path root-module-path) + ,@(if (string=? module-path-sans-suffix root-module-path) '() `(#:unpack-path ,root-module-path)))) ,@(maybe-propagated-inputs