From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id qEe1KNUIq1+DYQAA0tVLHw (envelope-from ) for ; Tue, 10 Nov 2020 21:40:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AJCBJNUIq1/8PAAAbx9fmQ (envelope-from ) for ; Tue, 10 Nov 2020 21:40:37 +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 5F1619402A7 for ; Tue, 10 Nov 2020 21:40:37 +0000 (UTC) Received: from localhost ([::1]:52098 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kcbNU-0004eN-4K for larch@yhetil.org; Tue, 10 Nov 2020 16:40:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:58032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kcbMz-0004Fx-2d for guix-patches@gnu.org; Tue, 10 Nov 2020 16:40:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55911) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kcbMy-0000X0-QD for guix-patches@gnu.org; Tue, 10 Nov 2020 16:40:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kcbMy-00070a-OF for guix-patches@gnu.org; Tue, 10 Nov 2020 16:40:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38408] [PATCH v16 5/6] import: utils: Trim patch version from names. Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Nov 2020 21:40: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 Cc: Martin Becze Received: via spool by 38408-submit@debbugs.gnu.org id=B38408.160504439626860 (code B ref 38408); Tue, 10 Nov 2020 21:40:04 +0000 Received: (at 38408) by debbugs.gnu.org; 10 Nov 2020 21:39:56 +0000 Received: from localhost ([127.0.0.1]:39214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcbMq-0006z3-CE for submit@debbugs.gnu.org; Tue, 10 Nov 2020 16:39:56 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:57039) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kcbMn-0006yf-Hm for 38408@debbugs.gnu.org; Tue, 10 Nov 2020 16:39:53 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 4CW1VK05tSz1qs0h; Tue, 10 Nov 2020 22:39:53 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 4CW1VJ74JPz1r570; Tue, 10 Nov 2020 22:39:52 +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 9oSvXEf1MEbu; Tue, 10 Nov 2020 22:39:51 +0100 (CET) Received: from hermia.goebel-consult.de (ppp-188-174-61-127.dynamic.mnet-online.de [188.174.61.127]) (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; Tue, 10 Nov 2020 22:39:51 +0100 (CET) Received: from thisbe.fritz.box (thisbe.fritz.box [192.168.110.24]) by hermia.goebel-consult.de (Postfix) with ESMTP id 9724F60406; Tue, 10 Nov 2020 22:40:10 +0100 (CET) From: Hartmut Goebel Date: Tue, 10 Nov 2020 22:39:32 +0100 Message-Id: <2ad891ae18822a86b60dbd4d148e4a8ab690a688.1605042644.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: kCceTadbwPoN From: Martin Becze 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/utils.scm | 7 ++++--- tests/crate.scm | 44 +++++++++++++++++++++---------------------- 2 files changed, 26 insertions(+), 25 deletions(-) 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 beaa696be0..65d5ac3389 100644 --- a/tests/crate.scm +++ b/tests/crate.scm @@ -280,7 +280,7 @@ (_ (error "Unexpected URL: " url))))) (match (crate->guix-package "foo") - ((define-public rust-foo-1.0.0 + ((define-public rust-foo-1.0 (package (name "rust-foo") (version "1.0.0") (source @@ -296,7 +296,7 @@ ('quasiquote (#:skip-build? #t #:cargo-inputs - (("rust-leaf-alice-1.0.0" ('unquote rust-leaf-alice-1.0.0)))))) + (("rust-leaf-alice" ('unquote rust-leaf-alice-1.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") @@ -359,7 +359,7 @@ (_ (error "Unexpected URL: " url))))) (match (crate-recursive-import "root") ;; rust-intermediate-2 has no dependency on the rust-leaf-alice package, so this is a valid ordering - (((define-public rust-leaf-alice-1.0.0 + (((define-public rust-leaf-alice-1.0 (package (name "rust-leaf-alice") (version (? string? ver)) @@ -378,7 +378,7 @@ (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public rust-leaf-bob-1.0.0 + (define-public rust-leaf-bob-1.0 (package (name "rust-leaf-bob") (version (? string? ver)) @@ -397,7 +397,7 @@ (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public rust-intermediate-2-1.0.0 + (define-public rust-intermediate-2-1.0 (package (name "rust-intermediate-2") (version (? string? ver)) @@ -414,13 +414,13 @@ (arguments ('quasiquote (#:skip-build? #t #:cargo-inputs - (("rust-leaf-bob-1.0.0" + (("rust-leaf-bob" ('unquote rust-leaf-bob-1.0.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public rust-intermediate-1-1.0.0 + (define-public rust-intermediate-1-1.0 (package (name "rust-intermediate-1") (version (? string? ver)) @@ -437,17 +437,17 @@ (arguments ('quasiquote (#:skip-build? #t #:cargo-inputs - (("rust-intermediate-2-1.0.0" - ,rust-intermediate-2-1.0.0) - ("rust-leaf-alice-1.0.0" - ('unquote rust-leaf-alice-1.0.0)) - ("rust-leaf-bob-1.0.0" - ('unquote rust-leaf-bob-1.0.0)))))) + (("rust-intermediate-2" + ,rust-intermediate-2-1.0) + ("rust-leaf-alice" + ('unquote rust-leaf-alice-1.0)) + ("rust-leaf-bob" + ('unquote rust-leaf-bob-1.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") (license (list license:expat license:asl2.0)))) - (define-public rust-root-1.0.0 + (define-public rust-root-1.0 (package (name "rust-root") (version (? string? ver)) @@ -464,14 +464,14 @@ (arguments ('quasiquote (#:skip-build? #t #:cargo-inputs - (("rust-intermediate-1-1.0.0" - ('unquote rust-intermediate-1-1.0.0)) - ("rust-intermediate-2-1.0.0" - ('unquote rust-intermediate-2-1.0.0)) - ("rust-leaf-alice-1.0.0" - ('unquote rust-leaf-alice-1.0.0)) - ("rust-leaf-bob-1.0.0" - ('unquote rust-leaf-bob-1.0.0)))))) + (("rust-intermediate-1" + ('unquote rust-intermediate-1-1.0)) + ("rust-intermediate-2" + ('unquote rust-intermediate-2-1.0)) + ("rust-leaf-alice" + ('unquote rust-leaf-alice-1.0)) + ("rust-leaf-bob" + ('unquote rust-leaf-bob-1.0)))))) (home-page "http://example.com") (synopsis "summary") (description "summary") -- 2.21.3