summaryrefslogtreecommitdiff
path: root/guix/import
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-12-30 22:49:09 +0100
committerLudovic Courtès <ludo@gnu.org>2019-12-30 23:18:16 +0100
commitc7ca707b59304a978cab8c5c25401259c6c18214 (patch)
treeb9dce786c6068ffd60d3e45b22818de0c96b21d8 /guix/import
parentddc291d74bae877d5e030a03d94964a8f3536817 (diff)
import: crate: Honor crate version for recursive imports.
Fixes <https://bugs.gnu.org/38709>. Reported by Valentin Ignatev <valentignatev@gmail.com>. * guix/import/crate.scm (crate-recursive-import): Add optional 'version' parameter and honor it. * guix/scripts/import/crate.scm (guix-import-crate): Pass VERSION as 2nd argument to 'crate-recursive-import'.
Diffstat (limited to 'guix/import')
-rw-r--r--guix/import/crate.scm9
1 files changed, 6 insertions, 3 deletions
diff --git a/guix/import/crate.scm b/guix/import/crate.scm
index 4c3f8000d0..405a26a877 100644
--- a/guix/import/crate.scm
+++ b/guix/import/crate.scm
@@ -231,10 +231,13 @@ latest version of CRATE-NAME."
string->license))
(append cargo-inputs cargo-development-inputs)))))
-(define (crate-recursive-import crate-name)
+(define* (crate-recursive-import crate-name #:optional version)
(recursive-import crate-name #f
- #:repo->guix-package (lambda (name repo)
- (crate->guix-package name))
+ #:repo->guix-package
+ (lambda (name repo)
+ (let ((version (and (string=? name crate-name)
+ version)))
+ (crate->guix-package name version)))
#:guix-name crate-name->package-name))
(define (guix-package->crate-name package)