diff options
author | rubicon <5662-rubicon@users.gitlab.alpinelinux.org> | 2022-07-12 18:56:49 +0800 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2022-07-15 10:15:16 +0000 |
commit | b4fef74d05c90f398593d235f1b26962dad8bce5 (patch) | |
tree | a7d81d35760e0baaed6ea56b15009ccec01d6e93 | |
parent | d9bed6832ca30161723fcb65611cdb79e926b83f (diff) |
community/perl-app-cpanminus: add -https subpackage
fixes #14003 by moving custom patches to a subpackage
-rw-r--r-- | community/perl-app-cpanminus/APKBUILD | 63 | ||||
-rw-r--r-- | community/perl-app-cpanminus/app-cpanminus-https.patch | 133 | ||||
-rw-r--r-- | community/perl-app-cpanminus/busybox-wget-compat.patch | 4 | ||||
-rw-r--r-- | community/perl-app-cpanminus/cpanms | 652 | ||||
-rw-r--r-- | community/perl-app-cpanminus/use-https-mirrors.patch | 47 |
5 files changed, 831 insertions, 68 deletions
diff --git a/community/perl-app-cpanminus/APKBUILD b/community/perl-app-cpanminus/APKBUILD index 3708885b8e9..0a462f9295e 100644 --- a/community/perl-app-cpanminus/APKBUILD +++ b/community/perl-app-cpanminus/APKBUILD @@ -5,17 +5,18 @@ pkgname=perl-app-cpanminus #_pkgreal is used by apkbuild-cpan to find modules at MetaCpan _pkgreal=App-cpanminus pkgver=1.7046 -pkgrel=0 +pkgrel=1 pkgdesc="Get, unpack, build and install modules from CPAN" url="https://metacpan.org/release/App-cpanminus/" arch="noarch" license="GPL-1.0-or-later OR Artistic-1.0-Perl" -depends="perl ssl_client ca-certificates-bundle" +depends="perl wget" options="net" # needed to ensure cpanminus is able to access CPAN -subpackages="$pkgname-doc" +subpackages="$pkgname-doc $pkgname-https" source="https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-$pkgver.tar.gz - use-https-mirrors.patch + app-cpanminus-https.patch busybox-wget-compat.patch + cpanms " builddir="$srcdir/$_pkgreal-$pkgver" _blibdir="$builddir/blib" @@ -24,30 +25,45 @@ _blibdir="$builddir/blib" # 1.7045-r0: # - CVE-2020-16154 +prepare() { + install -Dvm644 lib/App/cpanminus.pm \ + lib/App/cpanminus/https.pm + install -Dvm644 lib/App/cpanminus/fatscript.pm \ + -t lib/App/cpanminus/https/ + + default_prepare +} + build() { export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') - # cpanm is the same as fatscript.pm, except for additional - # processing by perlstrip. This removes whitespace and - # comments, "minifying" the code. Unfortunately, cpanm - # cannot be rebuilt by simply running perlstrip on a patched - # fatscript.pm. So, we remove the "minified" code from cpanm, - # and instead make it call into the patched fatscript.pm. - # This line using sed should be stable, because the comments - # it matches for deletion are script-generated, and any - # other problems will be detected in check(). - sed -i -e '/^# DO NOT EDIT/,/# END OF FATPACK CODE/ d' \ - -re 's/^(use App::cpanminus::)(script)/\1fat\2/' \ - "$builddir"/bin/cpanm + + # Generate manpage for cpanms + pod2man -u "$srcdir"/cpanms "$builddir"/cpanms.1 + PERL_MM_USE_DEFAULT=1 perl -I. Makefile.PL INSTALLDIRS=vendor make + + install -Dvm755 "$srcdir"/cpanms -t "$_blibdir"/script/ + install -Dvm644 "$builddir"/cpanms.1 -t "$_blibdir"/man1/ } check() { export CFLAGS=$(perl -MConfig -E 'say $Config{ccflags}') make test - # test if cpanm can access www.cpan.org + + msg "Testing cpanm with GNU wget" perl -I "$_blibdir"/lib \ "$_blibdir"/script/cpanm \ + --verbose --no-lwp \ + --from https://cpan.metacpan.org \ + --showdeps App::cpanminus + + msg "Testing cpanms with Busybox wget" + ln -sv "$(which busybox)" "$srcdir"/wget + export PATH="$srcdir:$PATH" + perl -I "$_blibdir"/lib \ + "$_blibdir"/script/cpanms \ + --verbose --no-lwp \ --showdeps App::cpanminus } @@ -56,8 +72,17 @@ package() { find "$pkgdir" \( -name perllocal.pod -o -name .packlist \) -delete } +https() { + pkgdesc="$pkgdesc via HTTPS" + depends="perl ssl_client ca-certificates-bundle" + + amove usr/bin/cpanms + amove usr/share/perl5/vendor_perl/App/cpanminus/https* +} + sha512sums=" ced5f264979eb50cc33ac566c0242998c9b9c158ba435b9a180810f58eaa0b28d0de70312ade10df0ee3808369423f7baa029f2be740461d20a695e5e24d0d9b App-cpanminus-1.7046.tar.gz -b775836197d4ae2244a60ff3f2ba6cf2aa3217cc71686d20fae0eff6f2dfc222f4cfb73a97ffcaf5756c52312104130dc9e3837f1cf5d1b711d81b0bd7dd41ca use-https-mirrors.patch -cd5aecb7f834dfef705f11fa8499b9257e299de862e1ef62d040da6b436191d7d42e48303113c118fb5604975a0ece950426c69382f1205328e9d28d08ac31e9 busybox-wget-compat.patch +cb1b97973aca4afbc460589fe97635e6d1f33853037dbe7348935cd71319f92a80299684591f1eb640aeedfdc5c90706fbf2d834cbf1dace80d0fa6052620632 app-cpanminus-https.patch +ccdc214d914197f5336c93faa0e9db12b62c026c3fee5e699a2cec7ea7a6d14f2becb9d8777f165de18200c50d85109bc14f83539d52e4dd8bca45b072097f81 busybox-wget-compat.patch +f5bddb41b2192b43ddf8565a7ff9549ae8f8c9779c1fd36a80010dae9b130d203c9c66207c0045f78140167c3384d62c534a7e05849a912819d0d50c5f174327 cpanms " diff --git a/community/perl-app-cpanminus/app-cpanminus-https.patch b/community/perl-app-cpanminus/app-cpanminus-https.patch new file mode 100644 index 00000000000..032081b4bfb --- /dev/null +++ b/community/perl-app-cpanminus/app-cpanminus-https.patch @@ -0,0 +1,133 @@ +--- a/lib/App/cpanminus/https.pm ++++ b/lib/App/cpanminus/https.pm +@@ -1,4 +1,4 @@ +-package App::cpanminus; ++package App::cpanminus::https; + our $VERSION = "1.7046"; + + =encoding utf8 +--- a/lib/App/cpanminus/https/fatscript.pm ++++ b/lib/App/cpanminus/https/fatscript.pm +@@ -1,4 +1,4 @@ +-package App::cpanminus::fatscript; ++package App::cpanminus::https::fatscript; + # + # This is a pre-compiled source code for the cpanm (cpanminus) program. + # For more details about how to install cpanm, go to the following URL: +@@ -469,7 +469,7 @@ + mirrors => [], + mirror_only => undef, + mirror_index => undef, +- cpanmetadb => "http://cpanmetadb.plackperl.org/v1.0/", ++ cpanmetadb => "https://cpanmetadb.plackperl.org/v1.0/", + perl => $^X, + argv => [], + local_lib => undef, +@@ -565,7 +565,7 @@ + 'h|help' => sub { $self->{action} = 'show_help' }, + 'V|version' => sub { $self->{action} = 'show_version' }, + 'perl=s' => sub { +- $self->diag("--perl is deprecated since it's known to be fragile in figuring out dependencies. Run `$_[1] -S cpanm` instead.\n", 1); ++ $self->diag("--perl is deprecated since it's known to be fragile in figuring out dependencies. Run `$_[1] -S cpanms` instead.\n", 1); + $self->{perl} = $_[1]; + }, + 'l|local-lib=s' => sub { $self->{local_lib} = $self->maybe_abs($_[1]) }, +@@ -810,7 +810,7 @@ + } + } + +- $self->chat("cpanm (App::cpanminus) $VERSION on perl $] built for $Config{archname}\n" . ++ $self->chat("cpanms (App::cpanminus) $VERSION on perl $] built for $Config{archname}\n" . + "Work directory is $self->{base}\n"); + } + +@@ -926,7 +926,7 @@ + sub search_metacpan { + my($self, $module, $version, $dev_release) = @_; + +- my $metacpan_uri = 'http://fastapi.metacpan.org/v1/download_url/'; ++ my $metacpan_uri = 'https://fastapi.metacpan.org/v1/download_url/'; + + my $url = $metacpan_uri . $module; + +@@ -943,7 +943,7 @@ + if ($dist_meta && $dist_meta->{download_url}) { + (my $distfile = $dist_meta->{download_url}) =~ s!.+/authors/id/!!; + local $self->{mirrors} = $self->{mirrors}; +- $self->{mirrors} = [ 'http://cpan.metacpan.org' ]; ++ $self->{mirrors} = [ 'https://cpan.metacpan.org' ]; + return $self->cpan_module($module, $distfile, $dist_meta->{version}); + } + +@@ -1019,7 +1019,7 @@ + for my $try (sort { $b->{version_obj} cmp $a->{version_obj} } @found) { + if ($self->satisfy_version($module, $try->{version_obj}, $version)) { + local $self->{mirrors} = $self->{mirrors}; +- unshift @{$self->{mirrors}}, 'http://backpan.perl.org' ++ unshift @{$self->{mirrors}}, 'https://backpan.perl.org' + unless $try->{latest}; + return $self->cpan_module($module, $try->{distfile}, $try->{version}); + } +@@ -1099,7 +1099,7 @@ + sub show_version { + my $self = shift; + +- print "cpanm (App::cpanminus) version $VERSION ($0)\n"; ++ print "cpanms (App::cpanminus) version $VERSION ($0)\n"; + print "perl version $] ($^X)\n\n"; + + print " \%Config:\n"; +@@ -1125,7 +1125,7 @@ + my $self = shift; + + if ($_[0]) { +- print <<USAGE; ++ print <<USAGE =~ s/cpanm/cpanms/gr; + Usage: cpanm [options] Module [...] + + Try `cpanm --help` or `man cpanm` for more options. +@@ -1133,7 +1133,7 @@ + return; + } + +- print <<HELP; ++ print <<HELP =~ s/cpanm(?!')/cpanms/gr; + Usage: cpanm [options] Module [...] + + Options: +@@ -1247,7 +1247,7 @@ + ! - Configure local::lib in your existing shell to set PERL_MM_OPT etc. + ! - Install local::lib by running the following commands + ! +- ! cpanm --local-lib=~/perl5 local::lib && eval \$(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) ++ ! cpanms --local-lib=~/perl5 local::lib && eval \$(perl -I ~/perl5/lib/perl5/ -Mlocal::lib) + ! + DIAG + sleep 2; +@@ -1317,7 +1317,7 @@ + + require local::lib; + { +- local $0 = 'cpanm'; # so curl/wget | perl works ++ local $0 = 'cpanms'; # so curl/wget | perl works + $base ||= "~/perl5"; + $base = local::lib->resolve_path($base); + if ($self->{self_contained}) { +@@ -1671,7 +1671,7 @@ + sub configure_mirrors { + my $self = shift; + unless (@{$self->{mirrors}}) { +- $self->{mirrors} = [ 'http://www.cpan.org' ]; ++ $self->{mirrors} = [ 'https://www.cpan.org' ]; + } + for (@{$self->{mirrors}}) { + s!^/!file:///!; +@@ -3180,7 +3180,7 @@ + + sub has_working_lwp { + my($self, $mirrors) = @_; +- my $https = grep /^https:/, @$mirrors; ++ my $https = @$mirrors == 0 || grep /^https:/, @$mirrors; # default mirrors use https + eval { + require LWP::UserAgent; # no fatpack + LWP::UserAgent->VERSION(5.802); diff --git a/community/perl-app-cpanminus/busybox-wget-compat.patch b/community/perl-app-cpanminus/busybox-wget-compat.patch index 8a3dbec3094..d42fc17cb90 100644 --- a/community/perl-app-cpanminus/busybox-wget-compat.patch +++ b/community/perl-app-cpanminus/busybox-wget-compat.patch @@ -28,8 +28,8 @@ a CPAN client with few dependencies. Since Busybox comes with Alpine, and Busybox wget now works when the '--retry-connrefused' option is removed, I have taken this approach. ---- a/lib/App/cpanminus/fatscript.pm -+++ b/lib/App/cpanminus/fatscript.pm +--- a/lib/App/cpanminus/https/fatscript.pm ++++ b/lib/App/cpanminus/https/fatscript.pm @@ -3226,7 +3226,7 @@ $self->chat("You have $wget\n"); my @common = ( diff --git a/community/perl-app-cpanminus/cpanms b/community/perl-app-cpanminus/cpanms new file mode 100644 index 00000000000..d88d0cce01d --- /dev/null +++ b/community/perl-app-cpanminus/cpanms @@ -0,0 +1,652 @@ +#!/usr/bin/perl +# +# This version of cpanminus has been modified in the following 3 ways: +# +# (1) The `--retry-connrefused` option for the wget backend has been +# commented out. This restores compatibility with Busybox wget +# that comes pre-installed in the Alpine base system. +# +# (2) The default CPAN mirrors have been changed from HTTP to HTTPS. +# This provides better security. Alpine's `apk` package manager +# ensures that the necessary dependencies for enabling HTTPS +# support with Busybox wget are installed with this package. +# +# (3) The `has_working_lwp` method has been altered to first check +# if @$mirrors provided to it as an argument is an empty array. +# This causes $https to be true when @$mirrors is empty, which +# is the behavior we want, because the default mirrors have +# been switched to HTTPS as stated above in (2). When $https +# is true, the eval-require check for LWP::Protocol::https +# runs, so if you don't have that installed, this version +# of cpanminus will fallback on wget, instead of displaying +# the "LWP will support https URLs if the LWP::Protocol::https +# module is installed" error message. +# +# If you're looking for the unmodified cpanminus, please install +# the `perl-app-cpanminus` package instead. + +use strict; +use App::cpanminus::https::fatscript; + +unless (caller) { + my $app = App::cpanminus::script->new; + $app->parse_options(@ARGV); + exit $app->doit; +} + +__END__ + +=head1 NAME + +cpanms - get, unpack build and install modules from CPAN via HTTPS + +=head1 SYNOPSIS + + cpanms Test::More # install Test::More + cpanms MIYAGAWA/Plack-0.99_05.tar.gz # full distribution path + cpanms http://example.org/LDS/CGI.pm-3.20.tar.gz # install from URL + cpanms ~/dists/MyCompany-Enterprise-1.00.tar.gz # install from a local file + cpanms --interactive Task::Kensho # Configure interactively + cpanms . # install from local directory + cpanms --installdeps . # install all the deps for the current directory + cpanms -L extlib Plack # install Plack and all non-core deps into extlib + cpanms --mirror http://cpan.cpantesters.org/ DBI # use the fast-syncing mirror + cpanms --from https://cpan.metacpan.org/ Plack # use only the HTTPS mirror + +=head1 MODIFICATIONS + +This version of cpanminus has been modified in the following 3 ways: + +=over 4 + +=item 1. + +The C<--retry-connrefused> option for the wget backend has been +commented out. This restores compatibility with Busybox wget +that comes pre-installed in the Alpine base system. + +=item 2. + +The default CPAN mirrors have been changed from HTTP to HTTPS. +This provides better security. Alpine's C<apk> package manager +ensures that the necessary dependencies for enabling HTTPS +support with Busybox wget are installed with this package. + +=item 3. + +The C<has_working_lwp> method has been altered to first check +if @$mirrors provided to it as an argument is an empty array. +This causes $https to be true when @$mirrors is empty, which +is the behavior we want, because the default mirrors have +been switched to HTTPS as stated above in (2). When $https +is true, the eval-require check for LWP::Protocol::https +runs, so if you don't have that installed, this version +of cpanminus will fallback on wget, instead of displaying +the "LWP will support https URLs if the LWP::Protocol::https +module is installed" error message. + +=back + +If you're looking for the unmodified cpanminus, please install +the C<perl-app-cpanminus> package instead. + +=head1 COMMANDS + +=over 4 + +=item (arguments) + +Command line arguments can be either a module name, distribution file, +local file path, HTTP URL or git repository URL. Following commands +will all work as you expect. + + cpanms Plack + cpanms Plack/Request.pm + cpanms MIYAGAWA/Plack-1.0000.tar.gz + cpanms /path/to/Plack-1.0000.tar.gz + cpanms http://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/Plack-0.9990.tar.gz + cpanms git://github.com/plack/Plack.git + +Additionally, you can use the notation using C<~> and C<@> to specify +version for a given module. C<~> specifies the version requirement in +the L<CPAN::Meta::Spec> format, while C<@> pins the exact version, and +is a shortcut for C<~"== VERSION">. + + cpanms Plack~1.0000 # 1.0000 or later + cpanms Plack~">= 1.0000, < 2.0000" # latest of 1.xxxx + cpanms Plack@0.9990 # specific version. same as Plack~"== 0.9990" + +The version query including specific version or range will be sent to +L<MetaCPAN> to search for previous releases. The query will search for +BackPAN archives by default, unless you specify C<--dev> option, in +which case, archived versions will be filtered out. + +For a git repository, you can specify a branch, tag, or commit SHA to +build. The default is C<master> + + cpanms git://github.com/plack/Plack.git@1.0000 # tag + cpanms git://github.com/plack/Plack.git@devel # branch + +=item -i, --install + +Installs the modules. This is a default behavior and this is just a +compatibility option to make it work like L<cpan> or L<cpanp>. + +=item --self-upgrade + +Upgrades itself. It's just an alias for: + + cpanms App::cpanminus + +=item --info + +Displays the distribution information in +C<AUTHOR/Dist-Name-ver.tar.gz> format in the standard out. + +=item --installdeps + +Installs the dependencies of the target distribution but won't build +itself. Handy if you want to try the application from a version +controlled repository such as git. + + cpanms --installdeps . + +=item --look + +Download and unpack the distribution and then open the directory with +your shell. Handy to poke around the source code or do manual +testing. + +=item -h, --help + +Displays the help message. + +=item -V, --version + +Displays the version number. + +=back + +=head1 OPTIONS + +You can specify the default options in C<PERL_CPANM_OPT> environment variable. + +=over 4 + +=item -f, --force + +Force install modules even when testing failed. + +=item -n, --notest + +Skip the testing of modules. Use this only when you just want to save +time for installing hundreds of distributions to the same perl and +architecture you've already tested to make sure it builds fine. + +Defaults to false, and you can say C<--no-notest> to override when it +is set in the default options in C<PERL_CPANM_OPT>. + +=item --test-only + +Run the tests only, and do not install the specified module or +distributions. Handy if you want to verify the new (or even old) +releases pass its unit tests without installing the module. + +Note that if you specify this option with a module or distribution +that has dependencies, these dependencies will be installed if you +don't currently have them. + +=item -S, --sudo + +Switch to the root user with C<sudo> when installing modules. Use this +if you want to install modules to the system perl include path. + +Defaults to false, and you can say C<--no-sudo> to override when it is +set in the default options in C<PERL_CPANM_OPT>. + +=item -v, --verbose + +Makes the output verbose. It also enables the interactive +configuration. (See --interactive) + +=item -q, --quiet + +Makes the output even more quiet than the default. It only shows the +successful/failed dependencies to the output. + +=item -l, --local-lib + +Sets the L<local::lib> compatible path to install modules to. You +don't need to set this if you already configure the shell environment +variables using L<local::lib>, but this can be used to override that +as well. + +=item -L, --local-lib-contained + +Same with C<--local-lib> but with L<--self-contained> set. All +non-core dependencies will be installed even if they're already +installed. + +For instance, + + cpanms -L extlib Plack + +would install Plack and all of its non-core dependencies into the +directory C<extlib>, which can be loaded from your application with: + + use local::lib '/path/to/extlib'; + +Note that this option does B<NOT> reliably work with perl installations +supplied by operating system vendors that strips standard modules from perl, +such as RHEL, Fedora and CentOS, B<UNLESS> you also install packages supplying +all the modules that have been stripped. For these systems you will probably +want to install the C<perl-core> meta-package which does just that. + +=item --self-contained + +When examining the dependencies, assume no non-core modules are +installed on the system. Handy if you want to bundle application +dependencies in one directory so you can distribute to other machines. + +=item --exclude-vendor + +Don't include modules installed under the 'vendor' paths when searching for +core modules when the C<--self-contained> flag is in effect. This restores +the behaviour from before version 1.7023 + +=item --mirror + +Specifies the base URL for the CPAN mirror to use, such as +C<http://cpan.cpantesters.org/> (you can omit the trailing slash). You +can specify multiple mirror URLs by repeating the command line option. + +You can use a local directory that has a CPAN mirror structure +(created by tools such as L<OrePAN> or L<Pinto>) by using a special +URL scheme C<file://>. If the given URL begins with `/` (without any +scheme), it is considered as a file scheme as well. + + cpanms --mirror file:///path/to/mirror + cpanms --mirror ~/minicpan # Because shell expands ~ to /home/user + +Defaults to C<http://www.cpan.org/>. + +=item --mirror-only + +Download the mirror's 02packages.details.txt.gz index file instead of +querying the CPAN Meta DB. This will also effectively opt out sending +your local perl versions to backend database servers such as CPAN Meta +DB and MetaCPAN. + +Select this option if you are using a local mirror of CPAN, such as +minicpan when you're offline, or your own CPAN index (a.k.a darkpan). + +=item --from, -M + + cpanms -M https://cpan.metacpan.org/ + cpanms --from https://cpan.metacpan.org/ + +Use the given mirror URL and its index as the I<only> source to search +and download modules from. + +It works similar to C<--mirror> and C<--mirror-only> combined, with a +small difference: unlike C<--mirror> which I<appends> the URL to the +list of mirrors, C<--from> (or C<-M> for short) uses the specified URL +as its I<only> source to download index and modules from. This makes +the option always override the default mirror, which might have been +set via global options such as the one set by C<PERL_CPANM_OPT> +environment variable. + +B<Tip:> It might be useful if you name these options with your shell +aliases, like: + + alias minicpanm='cpanms --from ~/minicpan' + alias darkpan='cpanms --from http://mycompany.example.com/DPAN' + +=item --mirror-index + +B<EXPERIMENTAL>: Specifies the file path to C<02packages.details.txt> +for module search index. + +=item --cpanmetadb + +B<EXPERIMENTAL>: Specifies an alternate URI for CPAN MetaDB index lookups. + +=item --metacpan + +Prefers MetaCPAN API over CPAN MetaDB. + +=item --cpanfile + +B<EXPERIMENTAL>: Specified an alternate path for cpanfile to search for, +when C<--installdeps> command is in use. Defaults to C<cpanfile>. + +=item --prompt + +Prompts when a test fails so that you can skip, force install, retry +or look in the shell to see what's going wrong. It also prompts when +one of the dependency failed if you want to proceed the installation. + +Defaults to false, and you can say C<--no-prompt> to override if it's +set in the default options in C<PERL_CPANM_OPT>. + +=item --dev + +B<EXPERIMENTAL>: search for a newer developer release as well. Defaults to false. + +=item --reinstall + +cpanms, when given a module name in the command line (i.e. C<cpanms +Plack>), checks the locally installed version first and skips if it is +already installed. This option makes it skip the check, so: + + cpanms --reinstall Plack + +would reinstall L<Plack> even if your locally installed version is +latest, or even newer (which would happen if you install a developer +release from version control repositories). + +Defaults to false. + +=item --interactive + +Makes the configuration (such as C<Makefile.PL> and C<Build.PL>) +interactive, so you can answer questions in the distribution that +requires custom configuration or Task:: distributions. + +Defaults to false, and you can say C<--no-interactive> to override +when it's set in the default options in C<PERL_CPANM_OPT>. + +=item --pp, --pureperl + +Prefer Pure perl build of modules by setting C<PUREPERL_ONLY=1> for +MakeMaker and C<--pureperl-only> for Build.PL based +distributions. Note that not all of the CPAN modules support this +convention yet. + +=item --with-recommends, --with-suggests + +B<EXPERIMENTAL>: Installs dependencies declared as C<recommends> and +C<suggests> respectively, per META spec. When these dependencies fail +to install, cpanms continues the installation, since they're just +recommendation/suggestion. + +Enabling this could potentially make a circular dependency for a few +modules on CPAN, when C<recommends> adds a module that C<recommends> +back the module in return. + +There's also C<--without-recommend> and C<--without-suggests> to +override the default decision made earlier in C<PERL_CPANM_OPT>. + +Defaults to false for both. + +=item --with-develop + +B<EXPERIMENTAL>: Installs develop phase dependencies in META files or +C<cpanfile> when used with C<--installdeps>. Defaults to false. + +=item --with-configure + +B<EXPERIMENTAL>: Installs configure phase dependencies in C<cpanfile> +when used with C<--installdeps>. Defaults to false. + +=item --with-feature, --without-feature, --with-all-features + +B<EXPERIMENTAL>: Specifies the feature to enable, if a module supports +optional features per META spec 2.0. + + cpanms --with-feature=opt_csv Spreadsheet::Read + +the features can also be interactively chosen when C<--interactive> +option is enabled. + +C<--with-all-features> enables all the optional features, and +C<--without-feature> can select a feature to disable. + +=item --configure-timeout, --build-timeout, --test-timeout + +Specify the timeout length (in seconds) to wait for the configure, +build and test process. Current default values are: 60 for configure, +3600 for build and 1800 for test. + +=item --configure-args, --build-args, --test-args, --install-args + +B<EXPERIMENTAL>: Pass arguments for configure/build/test/install +commands respectively, for a given module to install. + + cpanms DBD::mysql --configure-args="--cflags=... --libs=..." + +The argument is only enabled for the module passed as a command line +argument, not dependencies. + +=item --scandeps + +B<DEPRECATED>: Scans the depencencies of given modules and output the +tree in a text format. (See C<--format> below for more options) + +Because this command doesn't actually install any distributions, it +will be useful that by typing: + + cpanms --scandeps Catalyst::Runtime + +you can make sure what modules will be installed. + +This command takes into account which modules you already have +installed in your system. If you want to see what modules will be +installed against a vanilla perl installation, you might want to +combine it with C<-L> option. + +=item --format + +B<DEPRECATED>: Determines what format to display the scanned +dependency tree. Available options are C<tree>, C<json>, C<yaml> and +C<dists>. + +=over 8 + +=item tree + +Displays the tree in a plain text format. This is the default value. + +=item json, yaml + +Outputs the tree in a JSON or YAML format. L<JSON> and L<YAML> modules +need to be installed respectively. The output tree is represented as a +recursive tuple of: + + [ distribution, dependencies ] + +and the container is an array containing the root elements. Note that +there may be multiple root nodes, since you can give multiple modules +to the C<--scandeps> command. + +=item dists + +C<dists> is a special output format, where it prints the distribution +filename in the I<depth first order> after the dependency resolution, +like: + + GAAS/MIME-Base64-3.13.tar.gz + GAAS/URI-1.58.tar.gz + PETDANCE/HTML-Tagset-3.20.tar.gz + GAAS/HTML-Parser-3.68.tar.gz + GAAS/libwww-perl-5.837.tar.gz + +which means you can install these distributions in this order without +extra dependencies. When combined with C<-L> option, it will be useful +to replay installations on other machines. + +=back + +=item --save-dists + +Specifies the optional directory path to copy downloaded tarballs in +the CPAN mirror compatible directory structure +i.e. I<authors/id/A/AU/AUTHORS/Foo-Bar-version.tar.gz> + +If the distro tarball did not come from CPAN, for example from a local +file or from GitHub, then it will be saved under +I<vendor/Foo-Bar-version.tar.gz>. + +=item --uninst-shadows + +Uninstalls the shadow files of the distribution that you're +installing. This eliminates the confusion if you're trying to install +core (dual-life) modules from CPAN against perl 5.10 or older, or +modules that used to be XS-based but switched to pure perl at some +version. + +If you run cpanms as root and use C<INSTALL_BASE> or equivalent to +specify custom installation path, you SHOULD disable this option so +you won't accidentally uninstall dual-life modules from the core +include path. + +Defaults to true if your perl version is smaller than 5.12, and you +can disable that with C<--no-uninst-shadows>. + +B<NOTE>: Since version 1.3000 this flag is turned off by default for +perl newer than 5.12, since with 5.12 @INC contains site_perl directory +I<before> the perl core library path, and uninstalling shadows is not +necessary anymore and does more harm by deleting files from the core +library path. + +=item --uninstall, -U + +Uninstalls a module from the library path. It finds a packlist for +given modules, and removes all the files included in the same +distribution. + +If you enable local::lib, it only removes files from the local::lib +directory. + +If you try to uninstall a module in C<perl> directory (i.e. core +module), an error will be thrown. + +A dialog will be prompted to confirm the files to be deleted. If you pass +C<-f> option as well, the dialog will be skipped and uninstallation +will be forced. + +=item --cascade-search + +B<EXPERIMENTAL>: Specifies whether to cascade search when you specify +multiple mirrors and a mirror doesn't have a module or has a lower +version of the module than requested. Defaults to false. + +=item --skip-installed + +Specifies whether a module given in the command line is skipped if its latest +version is already installed. Defaults to true. + +B<NOTE>: The C<PERL5LIB> environment variable have to be correctly set +for this to work with modules installed using L<local::lib>, unless +you always use the C<-l> option. + +=item --skip-satisfied + +B<EXPERIMENTAL>: Specifies whether a module (and version) given in the +command line is skipped if it's already installed. + +If you run: + + cpanms --skip-satisfied CGI DBI~1.2 + +cpanms won't install them if you already have CGI (for whatever +versions) or have DBI with version higher than 1.2. It is similar to +C<--skip-installed> but while C<--skip-installed> checks if the +I<latest> version of CPAN is installed, C<--skip-satisfied> checks if +a requested version (or not, which means any version) is installed. + +Defaults to false. + +=item --verify + +Verify the integrity of distribution files retrieved from CPAN using CHECKSUMS +file, and SIGNATURES file (if found in the distribution). Defaults to false. + +Using this option does not verify the integrity of the CHECKSUMS file, and it's +unsafe to rely on this option if you're using a CPAN mirror that you do not trust. + +=item --report-perl-version + +Whether it reports the locally installed perl version to the various +web server as part of User-Agent. Defaults to true unless CI related +environment variables such as C<TRAVIS>, C<CI> or C<AUTOMATED_TESTING> +is enabled. You can disable it by using C<--no-report-perl-version>. + +=item --auto-cleanup + +Specifies the number of days in which cpanm's work directories +expire. Defaults to 7, which means old work directories will be +cleaned up in one week. + +You can set the value to C<0> to make cpan never cleanup those +directories. + +=item --man-pages + +Generates man pages for executables (man1) and libraries (man3). + +Defaults to true (man pages generated) unless C<-L|--local-lib-contained> +option is supplied in which case it's set to false. You can disable +it with C<--no-man-pages>. + +=item --lwp + +Uses L<LWP> module to download stuff over HTTP. Defaults to true, and +you can say C<--no-lwp> to disable using LWP, when you want to upgrade +LWP from CPAN on some broken perl systems. + +=item --wget + +Uses GNU Wget (if available) to download stuff. Defaults to true, and +you can say C<--no-wget> to disable using Wget. + +=item --curl + +Uses cURL (if available) to download stuff. Defaults to true, and +you can say C<--no-curl> to disable using cURL. + +Normally with C<--lwp>, C<--wget> and C<--curl> options set to true +(which is the default) cpanms tries L<LWP>, Wget, cURL and L<HTTP::Tiny> +(in that order) and uses the first one available. + +=back + +=head1 ENVIRONMENT VARIABLES + +=over 4 + +=item PERL_CPANM_HOME + +The directory cpanms should use to store downloads and build and test +modules. Defaults to the C<.cpanm> directory in your user's home +directory. + +=item PERL_CPANM_OPT + +If set, adds a set of default options to every cpanms command. These +options come first, and so are overridden by command-line options. + +=back + +=head1 SEE ALSO + +L<App::cpanminus> + +=head1 BUGS + +This version of cpanminus distributed under the name of C<cpanms> +has been modified by Rubicon for Alpine Linux. If you find any bugs +that are specific to this version (not reproducible with the original +cpanminus distributed in Alpine under the name of C<cpanm>), please +do not bother the original author, instead file a bug report at: +https://gitlab.alpinelinux.org/alpine/aports/-/issues . + +=head1 COPYRIGHT + +Copyright 2010- Tatsuhiko Miyagawa. + +=head1 AUTHOR + +Tatsuhiko Miyagawa + +=cut diff --git a/community/perl-app-cpanminus/use-https-mirrors.patch b/community/perl-app-cpanminus/use-https-mirrors.patch deleted file mode 100644 index feaee4011df..00000000000 --- a/community/perl-app-cpanminus/use-https-mirrors.patch +++ /dev/null @@ -1,47 +0,0 @@ ---- a/lib/App/cpanminus/fatscript.pm -+++ b/lib/App/cpanminus/fatscript.pm -@@ -469,7 +469,7 @@ - mirrors => [], - mirror_only => undef, - mirror_index => undef, -- cpanmetadb => "http://cpanmetadb.plackperl.org/v1.0/", -+ cpanmetadb => "https://cpanmetadb.plackperl.org/v1.0/", - perl => $^X, - argv => [], - local_lib => undef, -@@ -926,7 +926,7 @@ - sub search_metacpan { - my($self, $module, $version, $dev_release) = @_; - -- my $metacpan_uri = 'http://fastapi.metacpan.org/v1/download_url/'; -+ my $metacpan_uri = 'https://fastapi.metacpan.org/v1/download_url/'; - - my $url = $metacpan_uri . $module; - -@@ -943,7 +943,7 @@ - if ($dist_meta && $dist_meta->{download_url}) { - (my $distfile = $dist_meta->{download_url}) =~ s!.+/authors/id/!!; - local $self->{mirrors} = $self->{mirrors}; -- $self->{mirrors} = [ 'http://cpan.metacpan.org' ]; -+ $self->{mirrors} = [ 'https://cpan.metacpan.org' ]; - return $self->cpan_module($module, $distfile, $dist_meta->{version}); - } - -@@ -1019,7 +1019,7 @@ - for my $try (sort { $b->{version_obj} cmp $a->{version_obj} } @found) { - if ($self->satisfy_version($module, $try->{version_obj}, $version)) { - local $self->{mirrors} = $self->{mirrors}; -- unshift @{$self->{mirrors}}, 'http://backpan.perl.org' -+ unshift @{$self->{mirrors}}, 'https://backpan.perl.org' - unless $try->{latest}; - return $self->cpan_module($module, $try->{distfile}, $try->{version}); - } -@@ -1671,7 +1671,7 @@ - sub configure_mirrors { - my $self = shift; - unless (@{$self->{mirrors}}) { -- $self->{mirrors} = [ 'http://www.cpan.org' ]; -+ $self->{mirrors} = [ 'https://www.cpan.org' ]; - } - for (@{$self->{mirrors}}) { - s!^/!file:///!; |