GNU bug report logs - #27216
[PATCH 0/1] Update CPAN importer to use MetaCPAN v1 API.

Previous Next

Package: guix-patches;

Reported by: James Richardson <james <at> jamestechnotes.com>

Date: Sat, 3 Jun 2017 18:36:02 UTC

Severity: normal

Tags: patch

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 27216 in the body.
You can then email your comments to 27216 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#27216; Package guix-patches. (Sat, 03 Jun 2017 18:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Richardson <james <at> jamestechnotes.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 03 Jun 2017 18:36:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: James Richardson <james <at> jamestechnotes.com>
To: guix-patches <at> gnu.org
Cc: James Richardson <james <at> jamestechnotes.com>
Subject: [PATCH 0/1] Update CPAN importer to use MetaCPAN v1 API.
Date: Sat,  3 Jun 2017 14:34:40 -0400
The v0 MetaCPAN api has been shutdown. These changes allow the CPAN
importer to use v1 api.

-- 
2.13.0





Information forwarded to guix-patches <at> gnu.org:
bug#27216; Package guix-patches. (Sat, 03 Jun 2017 18:39:02 GMT) Full text and rfc822 format available.

Message #8 received at 27216 <at> debbugs.gnu.org (full text, mbox):

From: James Richardson <james <at> jamestechnotes.com>
To: 27216 <at> debbugs.gnu.org
Cc: James Richardson <james <at> jamestechnotes.com>
Subject: [PATCH 1/1] Update CPAN importer to use MetaCPAN v1 API.
Date: Sat,  3 Jun 2017 14:37:54 -0400
---
 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





Reply sent to ludo <at> gnu.org (Ludovic Courtès):
You have taken responsibility. (Wed, 07 Jun 2017 13:11:02 GMT) Full text and rfc822 format available.

Notification sent to James Richardson <james <at> jamestechnotes.com>:
bug acknowledged by developer. (Wed, 07 Jun 2017 13:11:02 GMT) Full text and rfc822 format available.

Message #13 received at 27216-done <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: James Richardson <james <at> jamestechnotes.com>
Cc: 27216-done <at> debbugs.gnu.org
Subject: Re: bug#27216: [PATCH 1/1] Update CPAN importer to use MetaCPAN v1
 API.
Date: Wed, 07 Jun 2017 15:10:45 +0200
Hi James,

James Richardson <james <at> jamestechnotes.com> skribis:

> ---
>  guix/import/cpan.scm | 4 ++--
>  tests/cpan.scm       | 4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)

I confirm that this fixes ‘guix import cpan’.
I added a commit log and pushed.  Thank you!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 06 Jul 2017 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 347 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.