guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add CRAN importer.


From: Ludovic Courtès
Subject: Re: [PATCH] Add CRAN importer.
Date: Tue, 18 Aug 2015 15:43:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hello Guix!

Ricardo Wurmus <address@hidden> skribis:

> attached is a patch to add a new importer for R packages published on
> CRAN.  (I still have to add tests for this.)

Yay!

> The importer fetches the HTML description of an R package from
> http://cran.r-project.org, converts it to SXML, and then tries to
> extract the relevant information from the SXML expression.

Do you have an idea of how stable that HTML page is?

> When I finished I thought that maybe this could be done with less effort
> by downloading the tarball from CRAN, extracting the plain text
> DESCRIPTION file containing the same information and parse that instead.
> But in order to get the tarball I’d have to parse the HTML anyway, so
> maybe that’s not so much better after all.

OK.

> This generates package expressions using the r-build-system — this build
> system does not yet exist, but I’ll prepare one soon, not least to test
> the importer.

Sounds good.

> From 8cb9622785feb79fbbe593099105160617ff6acb Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <address@hidden>
> Date: Fri, 24 Jul 2015 16:49:57 +0200
> Subject: [PATCH] import: Add 'cran' importer.
>
> * guix/import/cran.scm: New file.
> * guix/scripts/import.scm: Add "cran" to 'importers'.
> * guix/scripts/import/cran.scm: New file.
> * Makefile.am (MODULES): Add 'guix/import/cran.scm' and
>   'guix/scripts/import/cran.scm'.
> * doc/guix.texi (Invoking guix import): Document it.
> * po/guix/POTFILES.in: Add 'guix/scripts/import/cran.scm'.

[...]

> address@hidden cran
> address@hidden CRAN
> +Import meta-data from @uref{http://cran.r-project.org/, CRAN}.

s/\./, the central repository for the @uref{http://r-project.org,
address@hidden statistical and graphical environment}/

> +(define string->license
> +  (match-lambda
> +   ("AGPL-3" 'agpl3)
> +   ("Artistic-2.0" 'artistic2.0)
> +   ("Apache License 2.0" 'asl2.0)
> +   ("BSD_2_clause" 'bsd-2)
> +   ("BSD_3_clause" 'bsd-3)
> +   ("GPL-2" 'gpl2)
> +   ("GPL-3" 'GPL3)
> +   ("LGPL-2" 'lgpl2.0)
> +   ("LGPL-2.1" 'lgpl2.1)
> +   ("LGPL-3" 'lgpl3)

Does it actually mean “or any later version”, or is it just unspecified?

Overall this looks good to me...  with a couple of tests, of course.
:-)  The tests will notably serve as a reference of what HTML form is
expected, in case the HTML page changes.

Thank you!

Ludo’.



reply via email to

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