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

Re: Homepage in DPG packages



Hi Damyan,

Damyan Ivanov wrote:
> Now there's another caveat. Such kind of URLs can't use the cached CPAN
> information. Endless fun! :)

Presuming you're referring to the PAUSE indexes, please recall that
these are primarily intended as indexes of modules (as in "namespaces")
not distributions->modules mappings. The whole PAUSE/CPAN indexer thing
works on the basis of namespace-version pairs. Distribution naming
needn't bear any resemblance on the contents and vice versa. The most
prominent example is the libwww-perl distribution which contains LWP::*
among other stuff.

The version and author agnostic URLs are purely a search.cpan.org
interface feature. They're *not* a feature of CPAN or PAUSE. Now,
search.cpan.org is here to stay and those URLs will be reliable in the
future, so it's fine to use them as a homepage reference.

How about asking the search.cpan.org interface author, Graham Barr, for
help in this? He wrote code to extract the distribution names from the
distribution file name that seems to work reliably.
He could either share the code with you, so you can parse the PAUSE file
index ftp://ftp.cpan.org/pub/CPAN/modules/01modules.index.html or he
could set up some kind of web API for retrieving the meta information
(version, author, upload date) for an URL such as
search.cpan.org/dist/Foo-Bar.
In case Graham isn't interested or too busy, you could check out the
parse_dist_name routine in the PAR::Dist module. It's intended to parse
the meta information from PAR-distribution files, but it should do just
fine with regular CPAN .tar.gz's. If you impose some more restrictions
(ends with version), it should become quite reliable. Let me know if I
can help with this.

Best regards,
Steffen



Reply to: