From: James Richardson <james@jamestechnotes.com>
To: 27216@debbugs.gnu.org
Subject: bug#27216: [PATCH 1/1] Update CPAN importer to use MetaCPAN v1 API.
Date: Sat, 3 Jun 2017 14:37:54 -0400 [thread overview]
Message-ID: <20170603183754.24132-1-james@jamestechnotes.com> (raw)
In-Reply-To: <20170603183440.23770-1-james@jamestechnotes.com>
---
guix/import/cpan.scm | 4 ++--
tests/cpan.scm | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 32c5c310e..a41f91804 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -88,7 +88,7 @@
"Return the base distribution module for a given module. E.g. the 'ok'
module is distributed with 'Test::Simple', so (module->dist-name \"ok\") would
return \"Test-Simple\""
- (assoc-ref (json-fetch (string-append "https://api.metacpan.org/module/"
+ (assoc-ref (json-fetch (string-append "https://fastapi.metacpan.org/v1/module/"
module
"?fields=distribution"))
"distribution"))
@@ -113,7 +113,7 @@ return \"Test-Simple\""
"Return an alist representation of the CPAN metadata for the perl module MODULE,
or #f on failure. MODULE should be e.g. \"Test::Script\""
;; This API always returns the latest release of the module.
- (json-fetch (string-append "https://api.metacpan.org/release/" name)))
+ (json-fetch (string-append "https://fastapi.metacpan.org/v1/release/" name)))
(define (cpan-home name)
(string-append "http://search.cpan.org/dist/" name))
diff --git a/tests/cpan.scm b/tests/cpan.scm
index 8b588517c..de865b22b 100644
--- a/tests/cpan.scm
+++ b/tests/cpan.scm
@@ -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))))
--
2.13.0
next prev parent reply other threads:[~2017-06-03 18:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-03 18:34 bug#27216: [PATCH 0/1] Update CPAN importer to use MetaCPAN v1 API James Richardson
2017-06-03 18:37 ` James Richardson [this message]
2017-06-07 13:10 ` bug#27216: [PATCH 1/1] " Ludovic Courtès
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=20170603183754.24132-1-james@jamestechnotes.com \
--to=james@jamestechnotes.com \
--cc=27216@debbugs.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).