Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options

Listing scripts in distribution metadata

by perlancar (Friar)
on Oct 27, 2020 at 22:43 UTC ( #11123239=perlquestion: print w/replies, xml ) Need Help??

perlancar has asked for the wisdom of the Perl Monks concerning the following question:

I wonder why the CPAN distribution metadata does not define a more general 'provides' to let a distribution specifies the list of scripts or other documents that it contains, in addition to packages. It would make things easier for tools like MetaCPAN, or App::lcpan. Right now I believe (not confirmed yet by reading the source code) that MetaCPAN performs some static parsing of Makefile.PL to get EXE_FILES, but less-than-straightforward declaration of EXE_FILES will make it miss (example: Spreadsheet-Read's Makefile.PL).
  • Comment on Listing scripts in distribution metadata

Replies are listed 'Best First'.
Re: Listing scripts in distribution metadata
by tobyink (Canon) on Oct 27, 2020 at 23:56 UTC

    I've been using an x_provides_scripts hash in META.json, modelled after the standard provides hash. So say your distribution provides a "csv2json" script, your META.json would contain:

    "x_provides_scripts": { "csv2json": { "version": "0.1", "file": "bin/csv2json" } }
      Perfect. I'll be adding a support for x_provides_scripts in App::lcpan. I've also started to document the list of custom keys like this in CPAN::Meta::X.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://11123239]
Approved by choroba
Front-paged by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2020-12-01 06:34 GMT
Find Nodes?
    Voting Booth?

    No recent polls found