guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

04/07: import cran: Remove more invalid characters from package names.


From: Ricardo Wurmus
Subject: 04/07: import cran: Remove more invalid characters from package names.
Date: Sat, 17 Dec 2016 17:41:25 +0000 (UTC)

rekado pushed a commit to branch master
in repository guix.

commit 2e5f32ce1b2d552527b8eb9a85a100a92d6d252a
Author: Ricardo Wurmus <address@hidden>
Date:   Tue May 17 15:06:44 2016 +0200

    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-".
---
 guix/import/cran.scm |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index d2add6f..ee34ead 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]