From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] Add Bioconductor importer and updater. Date: Tue, 22 Dec 2015 23:01:58 +0100 Message-ID: <8760zq9m7d.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aBV0Q-0003xx-KT for guix-devel@gnu.org; Tue, 22 Dec 2015 17:02:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aBV0N-0005Nt-CZ for guix-devel@gnu.org; Tue, 22 Dec 2015 17:02:06 -0500 In-Reply-To: (Ricardo Wurmus's message of "Mon, 21 Dec 2015 17:00:54 +0100") 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ricardo Wurmus Cc: "guix-devel@gnu.org" Ricardo Wurmus skribis: > From 8829683fffc03dec7f2faecea75cdd7831ce1741 Mon Sep 17 00:00:00 2001 > From: Ricardo Wurmus > Date: Wed, 16 Dec 2015 14:45:28 +0100 > Subject: [PATCH] import: Add Bioconductor importer and updater. > > * guix/import/cran.scm (bioconductor->guix-package, > %bioconductor-updater, latest-bioconductor-release, > bioconductor-package?): New procedures. > (%bioconductor-url, %bioconductor-svn-url): New variables. > (description->package): Update signature to distinguish between packages > from different repositories. > (latest-release): Rename procedure ... > (latest-cran-release): ... to this. > (cran-package?): Do not assume all R packages are available on CRAN. > * tests/cran.scm: Update tests. > * guix/scripts/import/bioconductor.scm: New file. > * guix/scripts/import.scm (importers): Add "bioconductor" importers. > * guix/scripts/refresh.scm (%updaters): Add "%bioconductor-updater". > * doc/guix.texi: Document Bioconductor importer and updater. [...] > @item cran > the updater for @uref{http://cran.r-project.org/, CRAN} packages; > +@item bioconductor > +the updater for @uref{http://www.bioconductor.org/, Bioconductor} packag= es; =E2=80=9CR packages=E2=80=9D > - (properties ,`(,'quasiquote ((,'upstream-name . ,name)))) > + (properties ,`(,'quasiquote ((,'upstream-name . ,name) > + (,'r-repository . ,repository)))) What about adding =E2=80=98upstream-name=E2=80=99 only when the upstream na= me is different from the Guix name minus =E2=80=9Cr-=E2=80=9D? Regarding =E2=80=98r-repository=E2=80=99, I guess it can be inferred from t= he source URL? The risk with properties is that they are missing from current packages, they are easily forgotten (since there=E2=80=99s no expansion-time check for these), and forgetting them would lead to packages being silently ignored by =E2=80=98guix refresh=E2=80=99. > (define (cran-package? package) > "Return true if PACKAGE is an R package from CRAN." > - ;; Assume all R packages are available on CRAN. > - (string-prefix? "r-" (package-name package))) > + ;; Assume all R packages are available on CRAN, unless otherwise indic= ated > + ;; by the r-repository property. > + (let ((properties (package-properties package))) > + (and (string-prefix? "r-" (package-name package)) > + (or (not properties) > + (not (assoc-ref properties 'r-repository)) > + (eqv? 'cran (assoc-ref properties 'r-repository)))))) We could check whether the source URL starts with =E2=80=9Cmirror://cran=E2= =80=9D, no? And forget about the =E2=80=98r-repository=E2=80=99 property? > +(define (bioconductor-package? package) > + "Return true if PACKAGE is an R package from Bioconductor." > + (let ((properties (package-properties package))) > + (and (string-prefix? "r-" (package-name package)) > + properties > + (eqv? 'bioconductor (assoc-ref properties 'r-repository))))) Likewise, should we check based on the URL? > +++ b/guix/scripts/import/bioconductor.scm I was wondering whether this should be a separate script or not. A precedent would be the ELPA importer, which takes a repository name as an argument. We could have done the same with the CRAN importer here. WDYT? The rest LGTM. Thank you! Ludo=E2=80=99.