From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id sH5RL2LTsl8jaQAA0tVLHw (envelope-from ) for ; Mon, 16 Nov 2020 19:30:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id YLgqK2LTsl/QRQAA1q6Kng (envelope-from ) for ; Mon, 16 Nov 2020 19:30:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 54434940509 for ; Mon, 16 Nov 2020 19:30:42 +0000 (UTC) Received: from localhost ([::1]:49566 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kekD3-0005P9-8p for larch@yhetil.org; Mon, 16 Nov 2020 14:30:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:46292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kejrD-0001xb-HQ for guix-patches@gnu.org; Mon, 16 Nov 2020 14:08:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45726) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kejrB-0001FN-6X for guix-patches@gnu.org; Mon, 16 Nov 2020 14:08:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kejrB-0002t9-18 for guix-patches@gnu.org; Mon, 16 Nov 2020 14:08:05 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38408] [PATCH v17 6/8] import: utils: Trim patch version from names. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 16 Nov 2020 19:08:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38408 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38408@debbugs.gnu.org Received: via spool by 38408-submit@debbugs.gnu.org id=B38408.160555367611013 (code B ref 38408); Mon, 16 Nov 2020 19:08:04 +0000 Received: (at 38408) by debbugs.gnu.org; 16 Nov 2020 19:07:56 +0000 Received: from localhost ([127.0.0.1]:57258 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kejr2-0002rY-5d for submit@debbugs.gnu.org; Mon, 16 Nov 2020 14:07:56 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:35167) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kejr0-0002rR-Vy for 38408@debbugs.gnu.org; Mon, 16 Nov 2020 14:07:55 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CZdrB3z4dz1qs3l for <38408@debbugs.gnu.org>; Mon, 16 Nov 2020 20:07:54 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CZdrB3tcZz1rYDf for <38408@debbugs.gnu.org>; Mon, 16 Nov 2020 20:07:54 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id A4y7C3GtLgX4 for <38408@debbugs.gnu.org>; Mon, 16 Nov 2020 20:07:53 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-59-253.dynamic.mnet-online.de [188.174.59.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPS for <38408@debbugs.gnu.org>; Mon, 16 Nov 2020 20:07:53 +0100 (CET) Received: from thisbe.fritz.box (thisbe.fritz.box [192.168.110.24]) by hermia.goebel-consult.de (Postfix) with ESMTP id B044C604D4; Mon, 16 Nov 2020 20:08:28 +0100 (CET) From: Hartmut Goebel Date: Mon, 16 Nov 2020 20:07:26 +0100 Message-Id: <80ceca7e7d470e9f1e59edc219c80bbfd9b9a4d0.1605552418.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.21.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Score: -0.7 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.7 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: 3.99 X-TUID: etDKVC07orBT This remove the patch version from generated package names. For example 'rust-my-crate-1.1.2' now becomes 'rust-my-crate-1.1'. * guix/import/utils.scm (package->definition): Trim patch version from generated package names. * tests/crate.scm: (cargo>guix-package, cargo-recursive-import): Likewise. --- guix/import/crate.scm | 3 ++- guix/import/utils.scm | 7 ++++--- tests/crate.scm | 30 +++++++++++++++--------------- 3 files changed, 21 insertions(+), 19 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 9704b3087b..20efa131d5 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -159,7 +159,8 @@ and LICENSE." (map (match-lambda ((name version) - (list (crate-name->package-name name) version))) + (list (crate-name->package-name name) + (version-major+minor version)))) inputs)) (let* ((port (http-fetch (crate-uri name version))) diff --git a/guix/import/utils.scm b/guix/import/utils.scm index 10eb030188..b74393e617 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -269,9 +269,10 @@ package definition." ('package ('name name) ('version version) . rest) ('let _ ('package ('name name) ('version version) . rest))) - `(define-public ,(string->symbol (if append-version? - (string-append name "-" version) - version)) + `(define-public ,(string->symbol + (if append-version? + (string-append name "-" (version-major+minor version)) + version)) ,guix-package)))) (define (build-system-modules) diff --git a/tests/crate.scm b/tests/crate.scm index b6cd577552..3fbf6762c5 100644 --- a/tests/crate.scm +++ b/tests/crate.scm @@ -352,7 +352,7 @@ (_ (error "Unexpected URL: " url))))) (match (crate->guix-package "foo") - ((define-public 'rust-foo-1.0.3 + ((define-public 'rust-foo-1.0 (package (name "rust-foo") (version "1.0.3") (source @@ -369,7 +369,7 @@ (#:skip-build? #t #:cargo-inputs (("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7.5)))))) + ('unquote 'rust-leaf-alice-0.7)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") @@ -433,7 +433,7 @@ (match (crate-recursive-import "root") ;; rust-intermediate-b has no dependency on the rust-leaf-alice ;; package, so this is a valid ordering - (((define-public 'rust-leaf-alice-0.7.5 + (((define-public 'rust-leaf-alice-0.7 (package (name "rust-leaf-alice") (version "0.7.5") @@ -452,7 +452,7 @@ (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public 'rust-leaf-bob-3.0.1 + (define-public 'rust-leaf-bob-3.0 (package (name "rust-leaf-bob") (version "3.0.1") @@ -471,7 +471,7 @@ (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public 'rust-intermediate-b-1.2.3 + (define-public 'rust-intermediate-b-1.2 (package (name "rust-intermediate-b") (version "1.2.3") @@ -489,12 +489,12 @@ ('quasiquote (#:skip-build? #t #:cargo-inputs (("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3.0.1)))))) + ('unquote 'rust-leaf-bob-3.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public 'rust-intermediate-a-1.0.42 + (define-public 'rust-intermediate-a-1.0 (package (name "rust-intermediate-a") (version "1.0.42") @@ -512,16 +512,16 @@ ('quasiquote (#:skip-build? #t #:cargo-inputs (("rust-intermediate-b" - ('unquote 'rust-intermediate-b-1.2.3)) + ('unquote 'rust-intermediate-b-1.2)) ("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7.5)) + ('unquote 'rust-leaf-alice-0.7)) ("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3.0.1)))))) + ('unquote 'rust-leaf-bob-3.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public 'rust-root-1.0.4 + (define-public 'rust-root-1.0 (package (name "rust-root") (version "1.0.4") @@ -538,13 +538,13 @@ (arguments ('quasiquote (#:cargo-inputs (("rust-intermediate-a" - ('unquote 'rust-intermediate-a-1.0.42)) + ('unquote 'rust-intermediate-a-1.0)) ("rust-intermediate-b" - ('unquote 'rust-intermediate-b-1.2.3)) + ('unquote 'rust-intermediate-b-1.2)) ("rust-leaf-alice" - ('unquote 'rust-leaf-alice-0.7.5)) + ('unquote 'rust-leaf-alice-0.7)) ("rust-leaf-bob" - ('unquote 'rust-leaf-bob-3.0.1)))))) + ('unquote 'rust-leaf-bob-3.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") -- 2.21.3