Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-App-perlbrew for
openSUSE:Factory checked in at 2022-08-16 17:08:31
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-App-perlbrew (Old)
and /work/SRC/openSUSE:Factory/.perl-App-perlbrew.new.1521 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-App-perlbrew"
Tue Aug 16 17:08:31 2022 rev:31 rq:997346 version:0.96
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-App-perlbrew/perl-App-perlbrew.changes
2022-05-20 17:52:01.423296882 +0200
+++
/work/SRC/openSUSE:Factory/.perl-App-perlbrew.new.1521/perl-App-perlbrew.changes
2022-08-16 17:08:36.388032900 +0200
@@ -1,0 +2,13 @@
+Mon Aug 1 03:06:06 UTC 2022 - Tina M??ller <[email protected]>
+
+- updated to 0.96
+ see /usr/share/doc/packages/perl-App-perlbrew/Changes
+
+ 0.96
+ - Released at 2022-07-31T15:42:39+0900
+ - Thanks to our contributors: Rolf St??ckli
+ - `install-cpm` is now properly documented. Thanks to Tekki.
+ - Let `install` hint for `init` when PERLBREW_ROOT does not exist. .RT
#57669.
+ - Reveal the actual error code of curl/wget etc. Github issue #748.
+
+-------------------------------------------------------------------
Old:
----
App-perlbrew-0.95.tar.gz
New:
----
App-perlbrew-0.96.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-App-perlbrew.spec ++++++
--- /var/tmp/diff_new_pack.11kDMD/_old 2022-08-16 17:08:36.948034575 +0200
+++ /var/tmp/diff_new_pack.11kDMD/_new 2022-08-16 17:08:36.956034599 +0200
@@ -18,7 +18,7 @@
%define cpan_name App-perlbrew
Name: perl-App-perlbrew
-Version: 0.95
+Version: 0.96
Release: 0
License: MIT
Summary: Manage perl installations in your C<$HOME>
@@ -28,7 +28,7 @@
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
-BuildRequires: perl(CPAN::Perl::Releases) >= 5.20220313
+BuildRequires: perl(CPAN::Perl::Releases) >= 5.20220720
BuildRequires: perl(Capture::Tiny) >= 0.48
BuildRequires: perl(Devel::PatchPerl) >= 2.08
BuildRequires: perl(ExtUtils::MakeMaker) >= 7.22
@@ -48,7 +48,7 @@
BuildRequires: perl(Test::Spec) >= 0.49
BuildRequires: perl(Test::TempDir::Tiny) >= 0.016
BuildRequires: perl(local::lib) >= 2.000014
-Requires: perl(CPAN::Perl::Releases) >= 5.20220313
+Requires: perl(CPAN::Perl::Releases) >= 5.20220720
Requires: perl(Capture::Tiny) >= 0.48
Requires: perl(Devel::PatchPerl) >= 2.08
Requires: perl(ExtUtils::MakeMaker) >= 7.22
++++++ App-perlbrew-0.95.tar.gz -> App-perlbrew-0.96.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/Changes
new/App-perlbrew-0.96/Changes
--- old/App-perlbrew-0.95/Changes 2022-05-15 17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/Changes 2022-07-31 08:47:46.000000000 +0200
@@ -1,3 +1,10 @@
+0.96
+ - Released at 2022-07-31T15:42:39+0900
+ - Thanks to our contributors: Rolf St??ckli
+ - `install-cpm` is now properly documented. Thanks to Tekki.
+ - Let `install` hint for `init` when PERLBREW_ROOT does not exist. .RT
#57669.
+ - Reveal the actual error code of curl/wget etc. Github issue #748.
+
0.95
- Released at 2022-05-15T22:59:11+0800
- Thanks to our contributors: Leon Timmermans
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/MANIFEST
new/App-perlbrew-0.96/MANIFEST
--- old/App-perlbrew-0.95/MANIFEST 2022-05-15 17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/MANIFEST 2022-07-31 08:47:46.000000000 +0200
@@ -27,6 +27,7 @@
t/08.error_install.t
t/08.error_install_blead.t
t/08.error_install_cpanm.t
+t/08.error_install_cpm.t
t/09.exit_status.t
t/10.resolve.t
t/11.editdist.t
@@ -55,6 +56,7 @@
t/command-help.t
t/command-info.t
t/command-install-cpanm.t
+t/command-install-cpm.t
t/command-install-from-archive.t
t/command-install-patchperl.t
t/command-install.t
@@ -63,7 +65,12 @@
t/current_perl.t
t/current_shell.t
t/do_system.t
+t/error-http_download-exec-error.t
+t/error-http_download-exit-nonzero.t
+t/error-http_download-param-validation.t
+t/error-install-before-init.t
t/failure-command-install-cpanm.t
+t/failure-command-install-cpm.t
t/failure-command-install-patchperl.t
t/fake-bin/curl
t/home.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/META.json
new/App-perlbrew-0.96/META.json
--- old/App-perlbrew-0.95/META.json 2022-05-15 17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/META.json 2022-07-31 08:47:46.000000000 +0200
@@ -27,7 +27,7 @@
},
"runtime" : {
"requires" : {
- "CPAN::Perl::Releases" : "5.20220313",
+ "CPAN::Perl::Releases" : "5.20220720",
"Capture::Tiny" : "0.48",
"Devel::PatchPerl" : "2.08",
"ExtUtils::MakeMaker" : "7.22",
@@ -75,7 +75,7 @@
},
"App::perlbrew" : {
"file" : "lib/App/perlbrew.pm",
- "version" : "0.95"
+ "version" : "0.96"
}
},
"release_status" : "stable",
@@ -89,8 +89,8 @@
"web" : "https://github.com/gugod/App-perlbrew"
}
},
- "version" : "0.95",
- "x_serialization_backend" : "JSON::PP version 4.07",
+ "version" : "0.96",
+ "x_serialization_backend" : "JSON::PP version 4.06",
"x_spdx_expression" : "MIT",
"x_static_install" : "1"
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/META.yml
new/App-perlbrew-0.96/META.yml
--- old/App-perlbrew-0.95/META.yml 2022-05-15 17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/META.yml 2022-07-31 08:47:46.000000000 +0200
@@ -37,9 +37,9 @@
file: lib/App/Perlbrew/Util.pm
App::perlbrew:
file: lib/App/perlbrew.pm
- version: '0.95'
+ version: '0.96'
requires:
- CPAN::Perl::Releases: '5.20220313'
+ CPAN::Perl::Releases: '5.20220720'
Capture::Tiny: '0.48'
Devel::PatchPerl: '2.08'
ExtUtils::MakeMaker: '7.22'
@@ -52,7 +52,7 @@
resources:
bugtracker: https://github.com/gugod/App-perlbrew/issues
repository: https://github.com/gugod/App-perlbrew.git
-version: '0.95'
+version: '0.96'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
x_spdx_expression: MIT
x_static_install: '1'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/cpanfile
new/App-perlbrew-0.96/cpanfile
--- old/App-perlbrew-0.95/cpanfile 2022-05-15 17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/cpanfile 2022-07-31 08:47:46.000000000 +0200
@@ -1,5 +1,5 @@
# Always requires the latest for this two.
-requires 'CPAN::Perl::Releases' => '5.20220313';
+requires 'CPAN::Perl::Releases' => '5.20220720';
requires 'Devel::PatchPerl' => '2.08';
requires 'Capture::Tiny' => '0.48';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/lib/App/Perlbrew/HTTP.pm
new/App-perlbrew-0.96/lib/App/Perlbrew/HTTP.pm
--- old/App-perlbrew-0.95/lib/App/Perlbrew/HTTP.pm 2022-05-15
17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/lib/App/Perlbrew/HTTP.pm 2022-07-31
08:47:46.000000000 +0200
@@ -101,7 +101,15 @@
}
unless ($status == 0) {
$path->unlink;
- return "ERROR: Failed to execute the
command\n\n\t$download_command\n\nReason:\n\n\t$?";
+ if ($? == -1) {
+ return "ERROR: Failed to execute the
command\n\n\t$download_command\n\nReason:\n\n\t$!";
+ }
+ elsif ($? & 127) {
+ return "ERROR: The command died with signal " . ($? & 127) .
"\n\n\t$download_command\n\n";
+ }
+ else {
+ return "ERROR: The command finished with
error\n\n\t$download_command\n\nExit code:\n\n\t" . ($? >> 8);
+ }
}
return 0;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/lib/App/Perlbrew/Path.pm
new/App-perlbrew-0.96/lib/App/Perlbrew/Path.pm
--- old/App-perlbrew-0.95/lib/App/Perlbrew/Path.pm 2022-05-15
17:05:33.000000000 +0200
+++ new/App-perlbrew-0.96/lib/App/Perlbrew/Path.pm 2022-07-31
08:47:46.000000000 +0200
@@ -38,6 +38,12 @@
bless { path => _joinpath (@path) }, $class;
}
+sub exists {
+ my ($self) = @_;
+
+ -e $self->stringify;
+}
+
sub basename {
my ($self, $suffix) = @_;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/lib/App/perlbrew.pm
new/App-perlbrew-0.96/lib/App/perlbrew.pm
--- old/App-perlbrew-0.95/lib/App/perlbrew.pm 2022-05-15 17:05:33.000000000
+0200
+++ new/App-perlbrew-0.96/lib/App/perlbrew.pm 2022-07-31 08:47:46.000000000
+0200
@@ -2,7 +2,7 @@
use strict;
use warnings;
use 5.008;
-our $VERSION = "0.95";
+our $VERSION = "0.96";
use Config;
BEGIN {
@@ -1282,6 +1282,10 @@
sub run_command_install {
my ($self, $dist, $opts) = @_;
+ unless ($self->root->exists) {
+ die("ERROR: perlbrew root " . $self->root . " does not exist. Run
`perlbrew init` to prepare it first.\n");
+ }
+
unless ($dist) {
$self->run_command_help("install");
exit(-1);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/script/perlbrew
new/App-perlbrew-0.96/script/perlbrew
--- old/App-perlbrew-0.95/script/perlbrew 2022-05-15 17:05:33.000000000
+0200
+++ new/App-perlbrew-0.96/script/perlbrew 2022-07-31 08:47:46.000000000
+0200
@@ -42,6 +42,7 @@
install-patchperl Install patchperl
install-cpanm Install cpanm, a friendly companion.
+ install-cpm Install cpm, a faster but still friendly companion.
install-multiple Install multiple versions and flavors of perl
download Download the specified perl distribution tarball.
@@ -97,7 +98,7 @@
to make perlbrew install itself under the given PERLBREW_ROOT:
export PERLBREW_ROOT=/opt/perl5
- curl -L http://install.perlbrew.pl | bash
+ curl -L https://install.perlbrew.pl | bash
After doing this, the perlbrew executable is installed as
C</opt/perl5/bin/perlbrew>
@@ -128,7 +129,7 @@
=item PERLBREW_CPAN_MIRROR
-The CPAN mirror url of your choice. The default value is "http://www.cpan.org"
+The CPAN mirror url of your choice. By default, "https://cpan.metacpan.org" is
used.
=back
@@ -163,7 +164,7 @@
perlbrew install [options] <perl-release>
perlbrew install [options] /path/to/perl-5.14.0.tar.gz
perlbrew install [options] /path/to/perl/git/checkout/dir
- perlbrew install [options] http://example.com/mirror/perl-5.12.3.tar.gz
+ perlbrew install [options] https://example.com/mirror/perl-5.12.3.tar.gz
Build and install the wanted perl. The last argument can be a short string
designating a specific version which can be known from the output of C<perlbrew
available>, a path to a pre-downloaded tarball, a path to a git-checkout of
perl5 repo, or a URL to a tarball.
@@ -210,7 +211,7 @@
https://github.com/perl11/cperl/releases
-See http://perl11.org/cperl/ for more information about cperl distribution.
+See https://perl11.org/cperl/ for more information about cperl distribution.
Options for C<install> command:
@@ -343,12 +344,9 @@
List the recently available versions of perl on CPAN.
-The list is retrieved from the web page L<http://www.cpan.org/src/README.html>,
-and is not the list of *all* perl versions ever released in the past.
+By default, the latest sub-version of each stable versions are listed.
-To get a list of all perls ever released, use the C<--all> option.
-
-NOTICE: This command might be gone in the future and become an option of
'list' command.
+To get a list of all perls ever released, inculding development and RC
versions, run the command with C<--all> option.
=head1 COMMAND: OFF
@@ -492,7 +490,11 @@
Install the C<cpanm> standalone executable in C<$PERLBREW_ROOT/bin>.
For more rationale about the existence of this command, read
-<http://perlbrew.pl/Perlbrew-and-Friends.html>
+<https://perlbrew.pl/Perlbrew-and-Friends.html>
+
+Usage: perlbrew install-cpm
+
+Install the C<cpm> standalone executable in C<$PERLBREW_ROOT/bin>.
=head1 COMMAND: INSTALL-PATCHPERL
@@ -503,7 +505,7 @@
installer, but not with cpan.
For more rationale about the existence of this command, read
-<http://perlbrew.pl/Perlbrew-and-Friends.html>
+<https://perlbrew.pl/Perlbrew-and-Friends.html>
=head1 COMMAND: SELF-UPGRADE
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/08.error_install_cpm.t
new/App-perlbrew-0.96/t/08.error_install_cpm.t
--- old/App-perlbrew-0.95/t/08.error_install_cpm.t 1970-01-01
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/08.error_install_cpm.t 2022-07-31
08:47:46.000000000 +0200
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use FindBin;
+use lib $FindBin::Bin;
+use App::perlbrew;
+require 'test_helpers.pl';
+
+use Test::More;
+use Test::Exception;
+
+no warnings 'redefine';
+sub App::perlbrew::http_get { "" }
+
+throws_ok(
+ sub {
+ my $app = App::perlbrew->new("install-cpm");
+ $app->run;
+ },
+ qr[ERROR: Failed to retrieve cpm executable.]
+);
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/12.destdir.t
new/App-perlbrew-0.96/t/12.destdir.t
--- old/App-perlbrew-0.95/t/12.destdir.t 2022-05-15 17:05:33.000000000
+0200
+++ new/App-perlbrew-0.96/t/12.destdir.t 2022-07-31 08:47:46.000000000
+0200
@@ -12,12 +12,6 @@
use Test::More;
-## setup
-
-App::Perlbrew::Path
- ->new($ENV{PERLBREW_ROOT})
- ->rmpath;
-
## mock
no warnings 'redefine';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/12.sitecustomize.t
new/App-perlbrew-0.96/t/12.sitecustomize.t
--- old/App-perlbrew-0.95/t/12.sitecustomize.t 2022-05-15 17:05:33.000000000
+0200
+++ new/App-perlbrew-0.96/t/12.sitecustomize.t 2022-07-31 08:47:46.000000000
+0200
@@ -11,12 +11,6 @@
use Test::More;
-## setup
-
-App::Perlbrew::Path
- ->new ($ENV{PERLBREW_ROOT})
- ->rmpath;
-
## mock
no warnings 'redefine';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/command-install-cpm.t
new/App-perlbrew-0.96/t/command-install-cpm.t
--- old/App-perlbrew-0.95/t/command-install-cpm.t 1970-01-01
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/command-install-cpm.t 2022-07-31
08:47:46.000000000 +0200
@@ -0,0 +1,31 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::Spec;
+use File::Temp qw( tempdir );
+
+use App::perlbrew;
+$App::perlbrew::PERLBREW_ROOT = my $perlbrew_root = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = my $perlbrew_home = tempdir( CLEANUP => 1 );
+
+{
+ no warnings 'redefine';
+ sub App::perlbrew::http_get {
+ my ($url) = @_;
+ like $url, qr/cpm$/, "GET cpm url: $url";
+ return "#!/usr/bin/env perl\n# The content of cpm";
+ }
+}
+
+describe "App::perlbrew->install_cpm" => sub {
+ it "should produce 'cpm' in the bin dir" => sub {
+ my $app = App::perlbrew->new("install-cpm", "-q");
+ $app->run();
+
+ my $cpm = App::Perlbrew::Path->new($perlbrew_root, "bin", "cpm");
+ ok -f $cpm, "cpm is produced. $cpm";
+ ok -x $cpm, "cpm should be an executable.";
+ };
+};
+
+runtests unless caller;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/error-http_download-exec-error.t
new/App-perlbrew-0.96/t/error-http_download-exec-error.t
--- old/App-perlbrew-0.95/t/error-http_download-exec-error.t 1970-01-01
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/error-http_download-exec-error.t 2022-07-31
08:47:46.000000000 +0200
@@ -0,0 +1,26 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Test::More import => [ qw( done_testing like subtest ) ];
+use File::Temp qw( tempdir );
+
+BEGIN {
+ *CORE::GLOBAL::system = sub {
+ return $? = -1
+ };
+}
+
+use App::Perlbrew::Path;
+use App::Perlbrew::HTTP qw(http_download);
+
+local $ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP
=> 1 );
+
+subtest "The exit status code of curl", sub {
+ my $error = http_download( "https://example.com/whatever.tar.gz",
+
App::Perlbrew::Path->new($App::perlbrew::PERLBREW_ROOT)->child("whatever.tar.gz")
);
+
+ like $error, qr/^ERROR: Failed to execute the command/;
+};
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/App-perlbrew-0.95/t/error-http_download-exit-nonzero.t
new/App-perlbrew-0.96/t/error-http_download-exit-nonzero.t
--- old/App-perlbrew-0.95/t/error-http_download-exit-nonzero.t 1970-01-01
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/error-http_download-exit-nonzero.t 2022-07-31
08:47:46.000000000 +0200
@@ -0,0 +1,28 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Test::More import => [ qw( done_testing like subtest ) ];
+use File::Temp qw( tempdir );
+
+my $actual_status_code = 42;
+
+BEGIN {
+ *CORE::GLOBAL::system = sub {
+ return $? = $actual_status_code << 8;
+ };
+}
+
+use App::Perlbrew::Path;
+use App::Perlbrew::HTTP qw(http_download);
+
+local $ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP
=> 1 );
+
+subtest "The exit status code of curl", sub {
+ my $error = http_download( "https://example.com/whatever.tar.gz",
+
App::Perlbrew::Path->new($App::perlbrew::PERLBREW_ROOT)->child("whatever.tar.gz")
);
+
+ like $error, qr/^ERROR .+ Exit\ code: .+ ${actual_status_code}/xs;
+};
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/App-perlbrew-0.95/t/error-http_download-param-validation.t
new/App-perlbrew-0.96/t/error-http_download-param-validation.t
--- old/App-perlbrew-0.95/t/error-http_download-param-validation.t
1970-01-01 01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/error-http_download-param-validation.t
2022-07-31 08:47:46.000000000 +0200
@@ -0,0 +1,22 @@
+use strict;
+use warnings;
+use Test::More;
+use Test::Exception;
+use File::Temp qw(tempdir);
+use IO::All;
+use App::Perlbrew::HTTP qw(http_download);
+
+subtest "http_download: dies when when the download target already exists" =>
sub {
+ my $dir = tempdir( CLEANUP => 1 );
+ my $output = "$dir/whatever";
+
+ io($output)->print("so");
+
+ my $error;
+ throws_ok {
+ $error = http_download( "https://install.perlbrew.pl", $output );
+ }
+ qr(^ERROR: The download target < \Q$output\E > already exists\.$);
+};
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/error-install-before-init.t
new/App-perlbrew-0.96/t/error-install-before-init.t
--- old/App-perlbrew-0.95/t/error-install-before-init.t 1970-01-01
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/error-install-before-init.t 2022-07-31
08:47:46.000000000 +0200
@@ -0,0 +1,24 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+use File::Temp qw(tempdir);
+
+use App::perlbrew;
+use App::Perlbrew::Path;
+
+my $fakehome = tempdir( CLEANUP => 1 );
+
+$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT =
App::Perlbrew::Path->new($fakehome)->child("perl5")->stringify;
+
+throws_ok(
+ sub {
+ my $app = App::perlbrew->new("install", "perl-5.36.0");
+ $app->run;
+ },
+ qr[ERROR: .*perlbrew init.*]
+);
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/App-perlbrew-0.95/t/failure-command-install-cpm.t
new/App-perlbrew-0.96/t/failure-command-install-cpm.t
--- old/App-perlbrew-0.95/t/failure-command-install-cpm.t 1970-01-01
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.96/t/failure-command-install-cpm.t 2022-07-31
08:47:46.000000000 +0200
@@ -0,0 +1,38 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::Spec;
+use File::Temp qw( tempdir );
+
+use App::perlbrew;
+$App::perlbrew::PERLBREW_ROOT = my $perlbrew_root = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = my $perlbrew_home = tempdir( CLEANUP => 1 );
+
+{
+ no warnings 'redefine';
+ sub App::perlbrew::http_get {
+ my ($url) = @_;
+ like $url, qr/cpm$/, "GET cpm url: $url";
+ return "404 not found.";
+ }
+}
+
+describe "App::perlbrew->install_cpm" => sub {
+ it "should no produced 'cpm' in the bin dir, if the downloaded content
seems to be invalid." => sub {
+ my $error;
+ my $error_produced = 0;
+ eval {
+ my $app = App::perlbrew->new("install-cpm", "-q");
+ $app->run();
+ } or do {
+ $error = $@;
+ $error_produced = 1;
+ };
+
+ my $cpm = App::Perlbrew::Path->new($perlbrew_root, "bin", "cpm");
+ ok $error_produced, "generated an error: $error";
+ ok !(-f $cpm), "cpm is not produced. $cpm";
+ };
+};
+
+runtests unless caller;