import cran: Remove more invalid characters from package names.

* guix/import/cran.scm (guix-name): Replace period and underscore with
  dash; always prepend package names with "r-".
master
Ricardo Wurmus 2016-05-17 15:06:44 +02:00 committed by Ricardo Wurmus
parent 576eda6d02
commit 2e5f32ce1b
No known key found for this signature in database
GPG Key ID: 197A5888235FACAC
1 changed files with 5 additions and 3 deletions

View File

@ -152,9 +152,11 @@ empty list when the FIELD cannot be found."
"Return the `package' s-expression for an R package published on REPOSITORY
from the alist META, which was derived from the R package's DESCRIPTION file."
(define (guix-name name)
(if (string-prefix? "r-" name)
(string-downcase name)
(string-append "r-" (string-downcase name))))
(string-append "r-" (string-map (match-lambda
(#\_ #\-)
(#\. #\-)
(chr (char-downcase chr)))
name)))
(let* ((base-url (case repository
((cran) %cran-url)