summaryrefslogtreecommitdiff
path: root/guix/scripts/import/crate.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/scripts/import/crate.scm')
-rw-r--r--guix/scripts/import/crate.scm24
1 files changed, 22 insertions, 2 deletions
diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm
index 038faa87db..082a973aee 100644
--- a/guix/scripts/import/crate.scm
+++ b/guix/scripts/import/crate.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
;;; Copyright © 2023 Simon Tournier <zimon.toutoune@gmail.com>
+;;; Copyright © 2023 David Elsing <david.elsing@posteo.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -47,6 +48,13 @@
Import and convert the crates.io package for PACKAGE-NAME.\n"))
(display (G_ "
-r, --recursive import packages recursively"))
+ (display (G_ "
+ --recursive-dev-dependencies
+ include dev-dependencies recursively"))
+ (display (G_ "
+ --allow-yanked
+ allow importing yanked crates if no alternative
+ satisfying the version requirement exists"))
(newline)
(display (G_ "
-h, --help display this help and exit"))
@@ -67,6 +75,12 @@ Import and convert the crates.io package for PACKAGE-NAME.\n"))
(option '(#\r "recursive") #f #f
(lambda (opt name arg result)
(alist-cons 'recursive #t result)))
+ (option '("recursive-dev-dependencies") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'recursive-dev-dependencies #t result)))
+ (option '("allow-yanked") #f #f
+ (lambda (opt name arg result)
+ (alist-cons 'allow-yanked #t result)))
%standard-import-options))
@@ -92,8 +106,14 @@ Import and convert the crates.io package for PACKAGE-NAME.\n"))
(package-name->name+version spec))
(match (if (assoc-ref opts 'recursive)
- (crate-recursive-import name #:version version)
- (crate->guix-package name #:version version #:include-dev-deps? #t))
+ (crate-recursive-import
+ name #:version version
+ #:recursive-dev-dependencies?
+ (assoc-ref opts 'recursive-dev-dependencies)
+ #:allow-yanked? (assoc-ref opts 'allow-yanked))
+ (crate->guix-package
+ name #:version version #:include-dev-deps? #t
+ #:allow-yanked? (assoc-ref opts 'allow-yanked)))
((or #f '())
(leave (G_ "failed to download meta-data for package '~a'~%")
(if version