From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:59269) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iyxAe-00046w-7a for guix-patches@gnu.org; Tue, 04 Feb 2020 07:19:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iyxAX-0003bK-Tf for guix-patches@gnu.org; Tue, 04 Feb 2020 07:19:08 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36758) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iyxAX-0003Zm-M9 for guix-patches@gnu.org; Tue, 04 Feb 2020 07:19:05 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iyxAX-0003ml-Hg for guix-patches@gnu.org; Tue, 04 Feb 2020 07:19:05 -0500 Subject: [bug#38408] [PATCH v9 7/8] guix: import: utils: trim patch version from names Resent-Message-ID: From: Martin Becze Date: Tue, 4 Feb 2020 07:18:24 -0500 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 38408@debbugs.gnu.org Cc: ludo@gnu.org, efraim@flashner.co.il, jsoo1@asu.edu, Martin Becze * guix/import/utils.scm (package->definition): trim patch version from names * tests/crate.scm: updated the tests --- 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 518877d476..b902f008fd 100644 --- a/guix/import/utils.scm +++ b/guix/import/utils.scm @@ -273,9 +273,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 39561d5745..893dd70fc9 100644 --- a/tests/crate.scm +++ b/tests/crate.scm @@ -279,7 +279,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 @@ -295,7 +295,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") @@ -358,7 +358,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)) @@ -377,7 +377,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)) @@ -396,7 +396,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)) @@ -413,13 +413,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)) @@ -436,17 +436,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)) @@ -463,14 +463,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.25.0