Skip to content
Snippets Groups Projects
Commit 34a75d35 authored by Ricardo Wurmus's avatar Ricardo Wurmus
Browse files

import: Rename "cran-fetch" to "fetch-description".

* guix/import/cran.scm (cran-fetch): Rename procedure ...
(fetch-description): ... to this.
parent d1c11608
No related branches found
No related tags found
No related merge requests found
...@@ -109,11 +109,11 @@ (define* (maybe-inputs package-inputs #:optional (type 'inputs)) ...@@ -109,11 +109,11 @@ (define* (maybe-inputs package-inputs #:optional (type 'inputs))
(define %cran-url "http://cran.r-project.org/web/packages/") (define %cran-url "http://cran.r-project.org/web/packages/")
(define (cran-fetch name) (define (fetch-description base-url name)
"Return an alist of the contents of the DESCRIPTION file for the R package "Return an alist of the contents of the DESCRIPTION file for the R package
NAME, or #f on failure. NAME is case-sensitive." NAME, or #f on failure. NAME is case-sensitive."
;; This API always returns the latest release of the module. ;; This API always returns the latest release of the module.
(let ((url (string-append %cran-url name "/DESCRIPTION"))) (let ((url (string-append base-url name "/DESCRIPTION")))
(description->alist (read-string (http-fetch url))))) (description->alist (read-string (http-fetch url)))))
(define (listify meta field) (define (listify meta field)
...@@ -196,7 +196,7 @@ (define (guix-name name) ...@@ -196,7 +196,7 @@ (define (guix-name name)
(define (cran->guix-package package-name) (define (cran->guix-package package-name)
"Fetch the metadata for PACKAGE-NAME from cran.r-project.org, and return the "Fetch the metadata for PACKAGE-NAME from cran.r-project.org, and return the
`package' s-expression corresponding to that package, or #f on failure." `package' s-expression corresponding to that package, or #f on failure."
(let ((module-meta (cran-fetch package-name))) (let ((module-meta (fetch-description %cran-url package-name)))
(and=> module-meta description->package))) (and=> module-meta description->package)))
...@@ -230,7 +230,7 @@ (define upstream-name ...@@ -230,7 +230,7 @@ (define upstream-name
(package->upstream-name (specification->package package))) (package->upstream-name (specification->package package)))
(define meta (define meta
(cran-fetch upstream-name)) (fetch-description %cran-url upstream-name))
(and meta (and meta
(let ((version (assoc-ref meta "Version"))) (let ((version (assoc-ref meta "Version")))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment