From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: [PATCH 2/7] import cran: Move guix-name to top-level. Date: Mon, 23 May 2016 17:40:03 +0200 Message-ID: <1464018008-1767-3-git-send-email-ricardo.wurmus@mdc-berlin.de> References: <1464018008-1767-1-git-send-email-ricardo.wurmus@mdc-berlin.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ry7-000499-Sg for guix-devel@gnu.org; Mon, 23 May 2016 11:40:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4ry1-00034v-4S for guix-devel@gnu.org; Mon, 23 May 2016 11:40:34 -0400 Received: from pegasus.bbbm.mdc-berlin.de ([141.80.25.20]:58899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4ry0-00034i-ST for guix-devel@gnu.org; Mon, 23 May 2016 11:40:29 -0400 Received: from localhost (localhost [127.0.0.1]) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTP id 2D13C380EEA for ; Mon, 23 May 2016 17:40:28 +0200 (CEST) Received: from pegasus.bbbm.mdc-berlin.de ([127.0.0.1]) by localhost (pegasus.bbbm.mdc-berlin.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7BIEJviCjdWM for ; Mon, 23 May 2016 17:40:22 +0200 (CEST) Received: from HTCAONE.mdc-berlin.net (puck.citx.mdc-berlin.de [141.80.36.101]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pegasus.bbbm.mdc-berlin.de (Postfix) with ESMTPS for ; Mon, 23 May 2016 17:40:22 +0200 (CEST) In-Reply-To: <1464018008-1767-1-git-send-email-ricardo.wurmus@mdc-berlin.de> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org * guix/import/cran.scm (guix-name): Move to top-level. --- guix/import/cran.scm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 8b368af..0be5346 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -147,14 +147,16 @@ empty list when the FIELD cannot be found." (string-any char-set:whitespace item))) (map string-trim-both items)))))) + +(define (guix-name name) + "Return a Guix package name for a given R package name." + (string-append "r-" (string-downcase + (regexp-substitute/global #f "(_|\\.)" name + 'pre "-" 'post)))) + (define (description->package repository meta) "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) - (string-append "r-" (string-downcase - (regexp-substitute/global #f "(_|\\.)" name - 'pre "-" 'post)))) - (let* ((base-url (case repository ((cran) %cran-url) ((bioconductor) %bioconductor-url))) -- 2.7.3