develooper Front page | perl.module-authors | Postings from September 2018

Re: executable only Perl distributions & CPAN

Thread Previous | Thread Next
From:
Dan Book
Date:
September 7, 2018 20:18
Subject:
Re: executable only Perl distributions & CPAN
Message ID:
CABMkAVWBVhKbp2DofL4cqKZXZpm1nzxXg3ggq1weSN2hs1NDTA@mail.gmail.com
(duplicate reply because first one didn't go to the list)

On Fri, Sep 7, 2018 at 4:01 PM Diab Jerius <djerius@cpan.org> wrote:

> Howdy,
>
> My apologies if this topic has been covered elsewhere; I've been
> unable to concoct a search which would efficiently find it.
>
> I've authored a distribution which contains a single executable and no
> supporting modules. After injecting the tarball into my local darkpan
> via orepan2-inject, cpanm is unable to find it.
>
> I believe the problem is that as there are no packages, the "provides"
> field in META.yml is empty, and as 02packages.detail.txt lists only
> packages, it won't show up there.
>
> I see two options:
>
> 1.  Create an empty package which gets indexed; or
> 2.  Add an entry to the "provides" field mapping the distribution's
> "package" name (App::pltvectors) to the script file.
>
> Unfortunately, if a tool uses the "provides" field to verify that the
> listed package is in the script file it will fail, so this approach
> may lead to breakage.
>
> Is there a third option which doesn't require creating the empty file?
>
>
> Thanks,
>
> Diab
>
> P.S. I'm interested not just for my package, but also one of my
> old-time favorites on CPAN, makepatch, which isn't indexed on metacpan
> because of this (see
> https://github.com/metacpan/metacpan-web/issues/601) and thus isn't
> installable by CPAN clients, or indeed discoverable by metacpan, which
> is a shame.
>

CPAN distributions must contain a valid package, matching the filename,
which you have permissions for, with a higher version declared than
existing uploads of that module, in order to be indexed. Scripts are not
indexed by PAUSE, they aren't modules. So it should contain a file lib/App/
pltvectors.pm that contains package App::pltvectors and our $VERSION =
'...'. This ensures 1. that module name will be indexed, 2. it will be
installable by cpanm via that module name, 3. it will be able to satisfy
CPAN dependencies on that module name, 4. the module name is possible to
'use' (though this may not matter for such a distribution). If it's not for
CPAN but just for local installation then putting the info you suggest in
the 'provides' metadata should be enough, but it depends on how orepan
emulates the PAUSE indexer.

-Dan

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About