summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
authorHartmut Goebel <h.goebel@crazy-compilers.com>2020-11-14 19:47:32 +0100
committerHartmut Goebel <h.goebel@crazy-compilers.com>2020-12-02 22:09:23 +0100
commit9a48e35be853e10ba9b21bb91ef52a66b4264c84 (patch)
tree3aac9ceebe68a5f47a9ddf7fe5fec6da88701fdf /guix/import
parent50fbb3f032b46a565ca225daddf4eeb7c8edfab4 (diff)
import: utils: Trim patch version from names.
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.
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/crate.scm3
-rw-r--r--guix/import/utils.scm7
2 files changed, 6 insertions, 4 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)