From: rubicon Date: Mon, 02 May 2022 00:43:07 +0000 Subject: [PATCH] Remove '--retry-connrefused' for Busybox wget compatibility The '--retry-connrefused' option was added to fix an issue with search.cpan.org in 2010 (https://github.com/miyagawa/cpanminus/issues/15). Now, more than a decade later, the original search.cpan.org has shut down, and currently redirects to metacpan.org. MetaCPAN does not use the old search.cpan.org method of redirecting to a random mirror (which is what caused the original issue), but instead relies on Fastly (https://metacpan.org/about/sponsors) for CDN services. This makes the connection to MetaCPAN much more reliable, and the problem of redirecting to faulty mirrors is now no longer encountered. Additionally, when Curl added a '--retry-connrefused' option in 2016 (https://github.com/curl/curl/pull/1064), the Curl backend in cpanminus was not updated to add this option, which is further proof that the original redirection to faulty mirrors problem has been solved. According to the cpanminus manpage, the backends are tried in order of LWP (perl-libwww in Alpine repos), Wget, Curl, and HTTP::Tiny (which comes with Perl). If you have perl-libwww, then this problem with Busybox wget will not be encountered (unless you use HTTPS, in that case you will need perl-lwp-protocol-https too, otherwise cpanminus will still go on to try Wget). This problem could be solved by adding GNU wget to perl-app-cpanminus depends, but the whole point of cpanminus is to have 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/https/fatscript.pm +++ b/lib/App/cpanminus/https/fatscript.pm @@ -3226,7 +3226,7 @@ $self->chat("You have $wget\n"); my @common = ( '--user-agent', $self->agent, - '--retry-connrefused', +# '--retry-connrefused', ($self->{verbose} ? () : ('-q')), ); $self->{_backends}{get} = sub {