Alien-Build
view release on metacpan or search on metacpan
lib/Alien/Build/Plugin/Download/Negotiate.pm view on Meta::CPAN
=encoding UTF-8
=head1 NAME
Alien::Build::Plugin::Download::Negotiate - Download negotiation plugin
=head1 VERSION
version 2.84
=head1 SYNOPSIS
use alienfile;
share {
start_url 'http://ftp.gnu.org/gnu/make';
plugin 'Download' => (
filter => qr/^make-.*\.tar\.gz$/,
version => qr/([0-9\.]+)/,
);
};
=head1 DESCRIPTION
This is a negotiator plugin for downloading packages from the internet. This
plugin picks the best Fetch, Decode and Prefer plugins to do the actual work.
Which plugins are picked depend on the properties you specify, your platform
and environment. It is usually preferable to use a negotiator plugin rather
than the Fetch, Decode and Prefer plugins directly from your L<alienfile>.
=head1 PROPERTIES
=head2 url
[DEPRECATED] use C<start_url> instead.
The Initial URL for your package. This may be a directory listing (either in
HTML or ftp listing format) or the final tarball intended to be downloaded.
=head2 filter
This is a regular expression that lets you filter out files that you do not
want to consider downloading. For example, if the directory listing contained
tarballs and readme files like this:
foo-1.0.0.tar.gz
foo-1.0.0.readme
You could specify a filter of C<qr/\.tar\.gz$/> to make sure only tarballs are
considered for download.
=head2 version
Regular expression to parse out the version from a filename. The regular expression
should store the result in C<$1>.
Note: if you provide a C<version> property, this plugin will assume that you will
be downloading an initial index to select package downloads from. Depending on
the protocol (and typically this is the case for http and HTML) that may bring in
additional dependencies. If start_url points to a tarball or other archive directly
(without needing to do through an index selection process), it is recommended that
you not specify this property.
=head2 ssl
If your initial URL does not need SSL, but you know ahead of time that a subsequent
request will need it (for example, if your directory listing is on C<http>, but includes
links to C<https> URLs), then you can set this property to true, and the appropriate
Perl SSL modules will be loaded.
=head2 passive
If using FTP, attempt a passive mode transfer first, before trying an active mode transfer.
=head2 bootstrap_ssl
If set to true, then the download negotiator will avoid using plugins that have a dependency
on L<Net::SSLeay>, or other Perl SSL modules. The intent for this option is to allow
OpenSSL to be alienized and be a useful optional dependency for L<Net::SSLeay>.
The implementation may improve over time, but as of this writing, this option relies on you
having a working C<curl> or C<wget> with SSL support in your C<PATH>.
=head2 prefer
How to sort candidates for selection. This should be one of three types of values:
=over 4
=item code reference
This will be used as the prefer hook.
=item true value
Use L<Alien::Build::Plugin::Prefer::SortVersions>.
=item false value
Don't set any preference at all. A hook must be installed, or another prefer plugin specified.
=back
=head2 decoder
Override the detected decoder.
=head1 METHODS
=head2 pick
my($fetch, @decoders) = $plugin->pick;
Returns the fetch plugin and any optional decoders that should be used.
=head1 SEE ALSO
L<Alien::Build::Plugin::Prefer::BadVersion>, L<Alien::Build::Plugin::Prefer::GoodVersion>
L<Alien::Build>, L<alienfile>, L<Alien::Build::MM>, L<Alien>
( run in 0.702 second using v1.01-cache-2.11-cpan-3d66aa2751a )