Perl-Toolchain-Gang / CPAN-Common-Index

Common library for searching CPAN indexes
8 stars 10 forks source link

How do I find a source tar ball URI from CPAN::Common::Index retval? #5

Open tokuhirom opened 10 years ago

tokuhirom commented 10 years ago

CPAN::Common::Index returns the value in following form.

    {
      package => 'MOOSE',
      version => '2.0802',
      uri     => "cpan:///distfile/ETHER/Moose-2.0802.tar.gz"
    }

In this case, I can detect the tar ball path is http://www.cpan.org/authors/id/E/ET/ETHER/Moose-2.0802.tar.gz. But in ExtUtils::CBuilder, tar ball path is http://ftp.riken.jp/lang/CPAN/authors/id/A/AM/AMBS/ExtUtils/ExtUtils-CBuilder-0.280210.tar.gz. How do I find a source tar ball path from return value?

dagolden commented 10 years ago

I don't understand the question about ExtUtils::CBuilder. Can you give me a code sample showing what you mean? Generally, the bit after cpan:///distfile should be sufficient to determine the tarball under any CPAN mirror.

Eventually, the plan is to enhance URI::cpan to give you a CPAN path directly. I might work on that at the QA hackathon.

tokuhirom commented 10 years ago

I want to get a tar ball URI from URI::cpan object. But I can't get the tar ball URI from URI::cpan.

Ah, URI::cpan doesn't provide the feature yet? ... I'm waiting URI::cpan enhancement :)

tokuhirom commented 10 years ago

Ah, sorry. my code has a bug...

dagolden commented 10 years ago

I'm going to leave this open to remind me to make this easier when I'm at the QA hackathon.