summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2023-12-28 10:15:45 +0100
committerRicardo Wurmus <rekado@elephly.net>2024-01-01 14:35:15 +0100
commit513994aead5a5da6cdec51931bc8b624c66678e1 (patch)
treefcab74a248b363ece9a35ba6bb3465f101fdedbb /guix
parenta2a8c4c13aaf02038939706d9aaf6d9f386032c5 (diff)
import/cran: Restore format-inputs.
This fixes a regression introduced in commit e6223017d95bc615b2648f0798d9a3904d5b5f57 causing the selected input style to be ignored. * guix/import/cran.scm (format-inputs): New procedure. (maybe-inputs): Use it. Change-Id: I0d36f972fcb9888ed2be4ec9360bbcab13c25c5d
Diffstat (limited to 'guix')
-rw-r--r--guix/import/cran.scm19
1 files changed, 16 insertions, 3 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index e06001cdb7..fe1d32d79a 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -85,6 +85,21 @@
(define %input-style
(make-parameter 'variable)) ; or 'specification
+(define (format-inputs inputs)
+ "Generate a sorted list of package inputs from a list of upstream inputs."
+ (map (lambda (input)
+ (case (%input-style)
+ ((specification)
+ `(specification->package ,(upstream-input-name input)))
+ (else
+ ((compose string->symbol
+ upstream-input-downstream-name)
+ input))))
+ (sort inputs
+ (lambda (a b)
+ (string-ci<? (upstream-input-name a)
+ (upstream-input-name b))))))
+
(define (string->licenses license-string license-prefix)
(let ((licenses
(map string-trim-both
@@ -177,9 +192,7 @@ package definition."
(()
'())
((package-inputs ...)
- `((,input-type (list ,@(map (compose string->symbol
- upstream-input-downstream-name)
- package-inputs)))))))
+ `((,input-type (list ,@(format-inputs package-inputs)))))))
(define %cran-url "https://cran.r-project.org/web/packages/")
(define %cran-canonical-url "https://cran.r-project.org/package=")