summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2022-08-12 19:59:50 +0200
committerRicardo Wurmus <rekado@elephly.net>2022-09-20 17:02:33 +0200
commitec92bcaaddbe205f439b7ec11825117515e3d07c (patch)
treea963ba89b100dfe5698fddbf52e066624bb9838d /guix
parent8c620a60367e26b30dae22988e2ddc972b64234d (diff)
import/cran: description->package: Use COND and computed booleans.
* guix/import/cran.scm (description->package): Use COND with previously computed booleans instead of using CASE on REPOSITORY.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/cran.scm62
1 files changed, 31 insertions, 31 deletions
diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index 69d01b5f7c..d7f6945675 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -516,32 +516,32 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
(package
`(package
(name ,(cran-guix-name name))
- (version ,(case repository
- ((git)
- `(git-version ,version revision commit))
- ((hg)
- `(string-append ,version "-" revision "." changeset))
- (else version)))
+ (version ,(cond
+ (git?
+ `(git-version ,version revision commit))
+ (hg?
+ `(string-append ,version "-" revision "." changeset))
+ (else version)))
(source (origin
(method ,(cond
(git? 'git-fetch)
(hg? 'hg-fetch)
(else 'url-fetch)))
- (uri ,(case repository
- ((git)
- `(git-reference
- (url ,(assoc-ref meta 'git))
- (commit commit)))
- ((hg)
- `(hg-reference
- (url ,(assoc-ref meta 'hg))
- (changeset changeset)))
- (else
- `(,(procedure-name uri-helper) ,name version
- ,@(or (and=> (assoc-ref meta 'bioconductor-type)
- (lambda (type)
- (list (list 'quote type))))
- '())))))
+ (uri ,(cond
+ (git?
+ `(git-reference
+ (url ,(assoc-ref meta 'git))
+ (commit commit)))
+ (hg?
+ `(hg-reference
+ (url ,(assoc-ref meta 'hg))
+ (changeset changeset)))
+ (else
+ `(,(procedure-name uri-helper) ,name version
+ ,@(or (and=> (assoc-ref meta 'bioconductor-type)
+ (lambda (type)
+ (list (list 'quote type))))
+ '())))))
,@(cond
(git?
'((file-name (git-file-name name version))))
@@ -576,16 +576,16 @@ from the alist META, which was derived from the R package's DESCRIPTION file."
"")))
(license ,license))))
(values
- (case repository
- ((git)
- `(let ((commit ,(assoc-ref meta 'git-commit))
- (revision "1"))
- ,package))
- ((hg)
- `(let ((changeset ,(assoc-ref meta 'hg-changeset))
- (revision "1"))
- ,package))
- (else package))
+ (cond
+ (git?
+ `(let ((commit ,(assoc-ref meta 'git-commit))
+ (revision "1"))
+ ,package))
+ (hg?
+ `(let ((changeset ,(assoc-ref meta 'hg-changeset))
+ (revision "1"))
+ ,package))
+ (else package))
propagate)))
(define cran->guix-package