import: cpan: Update CPAN importer to use MetaCPAN v1 API.

* guix/import/cpan.scm (module->dist-name, cpan-fetch): Use metacpan.org
URLs.
* tests/cpan.scm ("cpan->guix-package"): Adjust accordingly.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
James Richardson 2017-06-03 14:37:54 -04:00 committed by Ludovic Courtès
parent fe4e0b0ae7
commit 4679dd6967
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 4 additions and 4 deletions

View file

@ -74,10 +74,10 @@
(mock ((guix http-client) http-fetch
(lambda (url . rest)
(match url
("https://api.metacpan.org/release/Foo-Bar"
("https://fastapi.metacpan.org/v1/release/Foo-Bar"
(values (open-input-string test-json)
(string-length test-json)))
("https://api.metacpan.org/module/Test::Script?fields=distribution"
("https://fastapi.metacpan.org/v1/module/Test::Script?fields=distribution"
(let ((result "{ \"distribution\" : \"Test-Script\" }"))
(values (open-input-string result)
(string-length result))))