unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
To: guix-devel@gnu.org
Subject: [PATCH 1/7] import cran: Remove more invalid characters from package names.
Date: Mon, 23 May 2016 17:32:13 +0200	[thread overview]
Message-ID: <1464017539-1478-1-git-send-email-ricardo.wurmus@mdc-berlin.de> (raw)

* guix/import/cran.scm (guix-name): Replace period and underscore with
  dash; always prepend package names with "r-".
---
 guix/import/cran.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/guix/import/cran.scm b/guix/import/cran.scm
index c1a9e8e..8b368af 100644
--- a/guix/import/cran.scm
+++ b/guix/import/cran.scm
@@ -151,9 +151,9 @@ 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-downcase
+                         (regexp-substitute/global #f "(_|\\.)" name
+                                                   'pre "-" 'post))))
 
   (let* ((base-url   (case repository
                        ((cran)         %cran-url)
-- 
2.7.3

             reply	other threads:[~2016-05-23 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-23 15:32 Ricardo Wurmus [this message]
2016-05-23 21:54 ` [PATCH 1/7] import cran: Remove more invalid characters from package names Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2016-05-23 15:40 [PATCH] Add recursive CRAN importer Ricardo Wurmus
2016-05-23 15:40 ` [PATCH 1/7] import cran: Remove more invalid characters from package names Ricardo Wurmus
2016-05-30  8:48   ` Ludovic Courtès
2016-06-14 15:02     ` Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464017539-1478-1-git-send-email-ricardo.wurmus@mdc-berlin.de \
    --to=ricardo.wurmus@mdc-berlin.de \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).