Hello community,

here is the log from the commit of package perl-App-perlbrew for 
openSUSE:Factory checked in at 2016-06-25 02:24:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-App-perlbrew (Old)
 and      /work/SRC/openSUSE:Factory/.perl-App-perlbrew.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-App-perlbrew"

Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-App-perlbrew/perl-App-perlbrew.changes      
2016-04-12 19:33:04.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.perl-App-perlbrew.new/perl-App-perlbrew.changes 
2016-06-25 02:24:08.000000000 +0200
@@ -1,0 +2,11 @@
+Thu Jun 23 05:51:51 UTC 2016 - co...@suse.com
+
+- updated to 0.76
+   see /usr/share/doc/packages/perl-App-perlbrew/Changes
+
+  0.76: # 2016-06-21T23:02:44+0200
+  - Start supporting cperl installation.
+  - cperl releases are sourced from: https://github.com/perl11/cperl/releases
+  - Deal with a regex warning when testing perlbrew with perl-5.25. See RT: 
https://rt.cpan.org/Ticket/Display.html?id=114871
+
+-------------------------------------------------------------------

Old:
----
  App-perlbrew-0.75.tar.gz

New:
----
  App-perlbrew-0.76.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-App-perlbrew.spec ++++++
--- /var/tmp/diff_new_pack.x5x2la/_old  2016-06-25 02:24:09.000000000 +0200
+++ /var/tmp/diff_new_pack.x5x2la/_new  2016-06-25 02:24:09.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           perl-App-perlbrew
-Version:        0.75
+Version:        0.76
 Release:        0
 %define cpan_name App-perlbrew
 Summary:        Manage perl installations in your C<$HOME>
@@ -30,14 +30,14 @@
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  perl
 BuildRequires:  perl-macros
-BuildRequires:  perl(CPAN::Perl::Releases) >= 1.94
-BuildRequires:  perl(Capture::Tiny) >= 0.25
-BuildRequires:  perl(Devel::PatchPerl) >= 1.28
+BuildRequires:  perl(CPAN::Perl::Releases) >= 2.60
+BuildRequires:  perl(Capture::Tiny) >= 0.36
+BuildRequires:  perl(Devel::PatchPerl) >= 1.40
 BuildRequires:  perl(File::Temp) >= 0.2304
 BuildRequires:  perl(IO::All) >= 0.51
 BuildRequires:  perl(Path::Class) >= 0.33
-BuildRequires:  perl(Pod::Parser) >= 1.62
-BuildRequires:  perl(Pod::Usage) >= 1.64
+BuildRequires:  perl(Pod::Parser) >= 1.63
+BuildRequires:  perl(Pod::Usage) >= 1.68
 BuildRequires:  perl(Test::Exception) >= 0.320000
 BuildRequires:  perl(Test::More) >= 1.001002
 BuildRequires:  perl(Test::NoWarnings) >= 1.04
@@ -45,11 +45,11 @@
 BuildRequires:  perl(Test::Simple) >= 1.001002
 BuildRequires:  perl(Test::Spec) >= 0.47
 BuildRequires:  perl(local::lib) >= 2.000014
-Requires:       perl(CPAN::Perl::Releases) >= 1.94
-Requires:       perl(Capture::Tiny) >= 0.25
-Requires:       perl(Devel::PatchPerl) >= 1.28
-Requires:       perl(Pod::Parser) >= 1.62
-Requires:       perl(Pod::Usage) >= 1.64
+Requires:       perl(CPAN::Perl::Releases) >= 2.60
+Requires:       perl(Capture::Tiny) >= 0.36
+Requires:       perl(Devel::PatchPerl) >= 1.40
+Requires:       perl(Pod::Parser) >= 1.63
+Requires:       perl(Pod::Usage) >= 1.68
 Requires:       perl(local::lib) >= 2.000014
 %{perl_requires}
 # MANUAL BEGIN

++++++ App-perlbrew-0.75.tar.gz -> App-perlbrew-0.76.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/Changes 
new/App-perlbrew-0.76/Changes
--- old/App-perlbrew-0.75/Changes       2016-03-16 23:51:16.000000000 +0100
+++ new/App-perlbrew-0.76/Changes       2016-06-21 23:05:27.000000000 +0200
@@ -1,3 +1,8 @@
+0.76: # 2016-06-21T23:02:44+0200
+- Start supporting cperl installation.
+- cperl releases are sourced from: https://github.com/perl11/cperl/releases
+- Deal with a regex warning when testing perlbrew with perl-5.25. See RT: 
https://rt.cpan.org/Ticket/Display.html?id=114871
+
 0.75: # 2016-03-16T23:41:41+0100
 - Thanks to our contributors: Dave Cross,  Dean Hamstead,  Mark J. Reed,  
Mohammed El-Afifi,
 - Add '--no-patchperl' install option for skip running patchperl.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/MANIFEST 
new/App-perlbrew-0.76/MANIFEST
--- old/App-perlbrew-0.75/MANIFEST      2016-03-16 23:50:28.000000000 +0100
+++ new/App-perlbrew-0.76/MANIFEST      2016-06-21 23:04:48.000000000 +0200
@@ -42,6 +42,11 @@
 t/13.perl_release.t
 t/14.perl_version_parsing.t
 t/15.no-reuse-build-dir.t
+t/16.release-detail.t
+t/17.release-detail-cperl-local.t
+t/17.release-detail-cperl-remote.t
+t/18.release-detail-perl-local.t
+t/18.release-detail-perl-remote.t
 t/command-alias.t
 t/command-available.t
 t/command-compgen.t
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/META.yml 
new/App-perlbrew-0.76/META.yml
--- old/App-perlbrew-0.75/META.yml      2016-03-16 23:52:14.000000000 +0100
+++ new/App-perlbrew-0.76/META.yml      2016-06-21 23:06:00.000000000 +0200
@@ -29,14 +29,14 @@
     - inc
     - t
 requires:
-  CPAN::Perl::Releases: '1.94'
-  Capture::Tiny: '0.25'
-  Devel::PatchPerl: '1.28'
-  Pod::Parser: '1.62'
-  Pod::Usage: '1.64'
+  CPAN::Perl::Releases: '2.60'
+  Capture::Tiny: '0.36'
+  Devel::PatchPerl: '1.40'
+  Pod::Parser: '1.63'
+  Pod::Usage: '1.68'
   local::lib: '2.000014'
   perl: 5.8.0
 resources:
   license: http://opensource.org/licenses/mit-license.php
   repository: git://github.com/gugod/App-perlbrew.git
-version: '0.75'
+version: '0.76'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/Makefile.PL 
new/App-perlbrew-0.76/Makefile.PL
--- old/App-perlbrew-0.75/Makefile.PL   2016-03-16 23:51:06.000000000 +0100
+++ new/App-perlbrew-0.76/Makefile.PL   2016-06-21 23:05:21.000000000 +0200
@@ -9,11 +9,11 @@
 repository 'git://github.com/gugod/App-perlbrew.git';
 
 requires
-    'CPAN::Perl::Releases' => '1.94',
-    'Capture::Tiny'        => '0.25',
-    'Devel::PatchPerl'     => '1.28',
-    'Pod::Parser'          => '1.62',
-    'Pod::Usage'           => '1.64',
+    'CPAN::Perl::Releases' => '2.60',
+    'Capture::Tiny'        => '0.36',
+    'Devel::PatchPerl'     => '1.40',
+    'Pod::Parser'          => '1.63',
+    'Pod::Usage'           => '1.68',
     'local::lib'           => '2.000014';
 
 test_requires
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/README new/App-perlbrew-0.76/README
--- old/App-perlbrew-0.75/README        2016-03-16 23:51:06.000000000 +0100
+++ new/App-perlbrew-0.76/README        2016-06-21 23:05:21.000000000 +0200
@@ -5,7 +5,7 @@
 ## SYNOPSIS
 
     # Installation
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
     # Initialize
     perlbrew init
@@ -51,7 +51,7 @@
 
 For the documentation of perlbrew usage see 
[perlbrew](https://metacpan.org/pod/perlbrew) command
 on [MetaCPAN](https://metacpan.org/), or by running `perlbrew help`,
-or by visiting [perlbrew's official website](http://perlbrew.pl/). The 
following documentation
+or by visiting [perlbrew's official website](https://perlbrew.pl/). The 
following documentation
 features the API of `App::perlbrew` module, and may not be remotely
 close to what your want to read.
 
@@ -60,11 +60,11 @@
 It is the simplest to use the perlbrew installer, just paste this statement to
 your terminal:
 
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
 Or this one, if you have `fetch` (default on FreeBSD):
 
-    fetch -o- http://install.perlbrew.pl | sh
+    fetch -o- https://install.perlbrew.pl | sh
 
 After that, `perlbrew` installs itself to `~/perl5/perlbrew/bin`, and you
 should follow the instruction on screen to modify your shell rc file to put it
@@ -84,7 +84,7 @@
 environment variable before running the installer:
 
     export PERLBREW_ROOT=/opt/perl5
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
 As a result, different users on the same machine can all share the same 
perlbrew
 root directory (although only original user that made the installation would
@@ -126,8 +126,8 @@
 
 ## PROJECT DEVELOPMENT
 
-[perlbrew project](http://perlbrew.pl/) uses github
-[http://github.com/gugod/App-perlbrew/issues](http://github.com/gugod/App-perlbrew/issues)
 and RT
+[perlbrew project](https://perlbrew.pl/) uses github
+[https://github.com/gugod/App-perlbrew/issues](https://github.com/gugod/App-perlbrew/issues)
 and RT
 <https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
 tracking. Issues sent to these two systems will eventually be reviewed
 and handled.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/README.md 
new/App-perlbrew-0.76/README.md
--- old/App-perlbrew-0.75/README.md     2016-03-16 23:51:06.000000000 +0100
+++ new/App-perlbrew-0.76/README.md     2016-06-21 23:05:21.000000000 +0200
@@ -5,7 +5,7 @@
 ## SYNOPSIS
 
     # Installation
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
     # Initialize
     perlbrew init
@@ -51,7 +51,7 @@
 
 For the documentation of perlbrew usage see 
[perlbrew](https://metacpan.org/pod/perlbrew) command
 on [MetaCPAN](https://metacpan.org/), or by running `perlbrew help`,
-or by visiting [perlbrew's official website](http://perlbrew.pl/). The 
following documentation
+or by visiting [perlbrew's official website](https://perlbrew.pl/). The 
following documentation
 features the API of `App::perlbrew` module, and may not be remotely
 close to what your want to read.
 
@@ -60,11 +60,11 @@
 It is the simplest to use the perlbrew installer, just paste this statement to
 your terminal:
 
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
 Or this one, if you have `fetch` (default on FreeBSD):
 
-    fetch -o- http://install.perlbrew.pl | sh
+    fetch -o- https://install.perlbrew.pl | sh
 
 After that, `perlbrew` installs itself to `~/perl5/perlbrew/bin`, and you
 should follow the instruction on screen to modify your shell rc file to put it
@@ -84,7 +84,7 @@
 environment variable before running the installer:
 
     export PERLBREW_ROOT=/opt/perl5
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
 As a result, different users on the same machine can all share the same 
perlbrew
 root directory (although only original user that made the installation would
@@ -126,8 +126,8 @@
 
 ## PROJECT DEVELOPMENT
 
-[perlbrew project](http://perlbrew.pl/) uses github
-[http://github.com/gugod/App-perlbrew/issues](http://github.com/gugod/App-perlbrew/issues)
 and RT
+[perlbrew project](https://perlbrew.pl/) uses github
+[https://github.com/gugod/App-perlbrew/issues](https://github.com/gugod/App-perlbrew/issues)
 and RT
 <https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
 tracking. Issues sent to these two systems will eventually be reviewed
 and handled.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/bin/perlbrew 
new/App-perlbrew-0.76/bin/perlbrew
--- old/App-perlbrew-0.75/bin/perlbrew  2016-03-16 23:51:06.000000000 +0100
+++ new/App-perlbrew-0.76/bin/perlbrew  2016-06-21 23:05:21.000000000 +0200
@@ -34,7 +34,7 @@
     off            Turn off perlbrew in current shell
     switch         Permanently use the specified perl as default
     switch-off     Permanently turn off perlbrew (revert to system perl)
-    exec           exec programs with specified perl enviroments.
+    exec           exec programs with specified perl environments.
 
     self-install       Install perlbrew itself under PERLBREW_ROOT/bin
     self-upgrade       Upgrade perlbrew itself.
@@ -173,6 +173,14 @@
 
 Add '--mirror $URL' to specify the URL of mirror site.
 
+=item B<install> [options] cperl-<version>
+
+Install the cperl distribution released from:
+
+    https://github.com/perl11/cperl/releases
+
+See  http://perl11.org/cperl/ for mor information about cperl distribution.
+
 =item B<install> [options]  perl-stable
 
 =item B<install> [options]  stable
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/lib/App/perlbrew.pm 
new/App-perlbrew-0.76/lib/App/perlbrew.pm
--- old/App-perlbrew-0.75/lib/App/perlbrew.pm   2016-03-16 23:51:16.000000000 
+0100
+++ new/App-perlbrew-0.76/lib/App/perlbrew.pm   2016-06-21 23:05:27.000000000 
+0200
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008;
-our $VERSION = "0.75";
+our $VERSION = "0.76";
 use Config;
 
 BEGIN {
@@ -21,6 +21,7 @@
 
 use File::Glob 'bsd_glob';
 use Getopt::Long ();
+use CPAN::Perl::Releases;
 
 sub min(@) {
     my $m = $_[0];
@@ -190,10 +191,18 @@
             die "ERROR: The download target < $path > already exists.\n";
         }
 
+        my $partial = 0;
+        local $SIG{TERM} = local $SIG{INT} = sub { $partial++ };
+
         my $download_command = http_user_agent_command( download => { url => 
$url, output => $path } );
 
         my $status = system($download_command);
+        if ($partial) {
+            unlink($path) if -f $path;
+            return "ERROR: Interrupted.";
+        }
         unless ($status == 0) {
+            unlink($path) if -f $path;
             return "ERROR: Failed to execute the 
command\n\n\t$download_command\n\nReason:\n\n\t$?";
         }
         return 0;
@@ -508,12 +517,9 @@
 
     my @commands = sort {
         $a->[1] <=> $b->[1]
-    } grep {
-        defined
     } map {
         my $d = editdist($_, $command);
-
-        ($d < $SIMILAR_DISTANCE) ? [ $_, $d ] : undef
+        (($d < $SIMILAR_DISTANCE) ? [ $_, $d ] : ())
     } $self->commands;
 
     if(@commands) {
@@ -716,9 +722,18 @@
 
 sub perl_release {
     my ($self, $version) = @_;
-
     my $mirror = $self->cpan_mirror();
 
+    # try CPAN::Perl::Releases
+    my $tarballs = CPAN::Perl::Releases::perl_tarballs($version);
+
+    my $x = (values %$tarballs)[0];
+    if ($x) {
+        my $dist_tarball = (split("/", $x))[-1];
+        my $dist_tarball_url = "$mirror/authors/id/$x";
+        return ($dist_tarball, $dist_tarball_url);
+    }
+
     # try src/5.0 symlinks, either perl-5.X or perl5.X; favor .tar.bz2 over 
.tar.gz
     my $index = http_get("http://www.cpan.org/src/5.0/";);
     if ($index) {
@@ -732,16 +747,79 @@
         }
     }
 
-    # try CPAN::Perl::Releases
-    require CPAN::Perl::Releases;
-    my $tarballs = CPAN::Perl::Releases::perl_tarballs($version);
+    my $html = http_get("http://search.cpan.org/dist/perl-${version}";, { 
'Cookie' => "cpan=$mirror" });
 
-    my $x = (values %$tarballs)[0];
+    unless ($html) {
+        die "ERROR: Failed to locate perl-${version} tarball.";
+    }
 
-    if ($x) {
-        my $dist_tarball = (split("/", $x))[-1];
-        my $dist_tarball_url = "$mirror/authors/id/$x";
-        return ($dist_tarball, $dist_tarball_url);
+    my ($dist_path, $dist_tarball) =
+        $html =~ m[<a 
href="(/CPAN/authors/id/.+/(perl-${version}.tar.(gz|bz2)))">Download</a>];
+    die "ERROR: Cannot find the tarball for perl-$version\n"
+        if !$dist_path and !$dist_tarball;
+    my $dist_tarball_url = "http://search.cpan.org${dist_path}";;
+    return ($dist_tarball, $dist_tarball_url);
+}
+
+sub cperl_release {
+    my ($self, $version) = @_;
+    my %url = (
+        "5.22.3" => 
"https://github.com/perl11/cperl/releases/download/cperl-5.22.3/cperl-5.22.3.tar.gz";,
+        "5.22.2" => 
"https://github.com/perl11/cperl/releases/download/cperl-5.22.2/cperl-5.22.2.tar.gz";,
+        "5.24.0-RC1" => 
"https://github.com/perl11/cperl/releases/download/cperl-5.24.0-RC1/cperl-5.24.0-RC1.tar.gz";,
+    );
+    # my %digest => {
+    #     "5.22.3" => "bcf494a6b12643fa5e803f8e0d9cef26312b88fc",
+    #     "5.22.2" => "8615964b0a519cf70d69a155b497de98e6a500d0",
+    # };
+
+    my $dist_tarball_url = $url{$version}or die "ERROR: Cannot find the 
tarball for cperl-$version\n";
+    my $dist_tarball = "cperl-${version}.tar.gz";
+    return ($dist_tarball, $dist_tarball_url);
+}
+
+sub release_detail_perl_local {
+    my ($self, $dist, $rd) = @_;
+    $rd ||= {};
+    my $error = 1;
+    my $mirror = $self->cpan_mirror();
+    my $tarballs = CPAN::Perl::Releases::perl_tarballs($rd->{version});
+    if (keys %$tarballs) {
+        for ("tar.bz2", "tar.gz") {
+            if (my $x = $tarballs->{$_}) {
+                $rd->{tarball_name} = (split("/", $x))[-1];
+                $rd->{tarball_url} = "$mirror/authors/id/$x";
+                $error = 0;
+                last;
+            }
+        }
+    }
+    return ($error, $rd);
+}
+
+sub release_detail_perl_remote {
+    my ($self, $dist, $rd) = @_;
+    $rd ||= {};
+    my $error = 1;
+    my $mirror = $self->cpan_mirror();
+
+    my $version = $rd->{version};
+
+    # try src/5.0 symlinks, either perl-5.X or perl5.X; favor .tar.bz2 over 
.tar.gz
+    my $index = http_get("http://www.cpan.org/src/5.0/";);
+    if ($index) {
+        for my $prefix ( "perl-", "perl" ){
+            for my $suffix ( ".tar.bz2", ".tar.gz" ) {
+                my $dist_tarball = "$prefix$version$suffix";
+                my $dist_tarball_url = "$mirror/src/5.0/$dist_tarball";
+                if ( $index =~ /href\s*=\s*"\Q$dist_tarball\E"/ms ) {
+                    $rd->{tarball_url} = $dist_tarball_url;
+                    $rd->{tarball_name} = $dist_tarball;
+                    $error = 0;
+                    return ($error, $rd);
+                }
+            }
+        }
     }
 
     my $html = http_get("http://search.cpan.org/dist/perl-${version}";, { 
'Cookie' => "cpan=$mirror" });
@@ -755,7 +833,72 @@
     die "ERROR: Cannot find the tarball for perl-$version\n"
         if !$dist_path and !$dist_tarball;
     my $dist_tarball_url = "http://search.cpan.org${dist_path}";;
-    return ($dist_tarball, $dist_tarball_url);
+
+    $rd->{tarball_name} = $dist_tarball;
+    $rd->{tarball_url} = $dist_tarball_url;
+    $error = 0;
+
+    return ($error, $rd);
+}
+
+sub release_detail_cperl_local {
+    my ($self, $dist, $rd) = @_;
+    $rd ||= {};
+    my %url = (
+        "cperl-5.22.3" => 
"https://github.com/perl11/cperl/releases/download/cperl-5.22.3/cperl-5.22.3.tar.gz";,
+        "cperl-5.22.2" => 
"https://github.com/perl11/cperl/releases/download/cperl-5.22.2/cperl-5.22.2.tar.gz";,
+        "cperl-5.24.0-RC1" => 
"https://github.com/perl11/cperl/releases/download/cperl-5.24.0-RC1/cperl-5.24.0-RC1.tar.gz";,
+    );
+
+    my $error = 1;
+    if ( my $u = $url{$dist} ) {
+        $rd->{tarball_name} = "${dist}.tar.gz";
+        $rd->{tarball_url} = $u;
+        $error = 0;
+    }
+    return ($error, $rd);
+}
+
+sub release_detail_cperl_remote {
+    my ($self, $dist, $rd) = @_;
+    $rd ||= {};
+    my $expect_href = "/perl11/cperl/releases/download/${dist}/${dist}.tar.gz";
+    my $expect_url = 
"https://github.com/perl11/cperl/releases/download/${dist}/${dist}.tar.gz";;
+    my $html = http_get('https://github.com/perl11/cperl/releases');
+    my $error = 1;
+    if ($html =~ m{ <a \s+ href="$expect_href" }xsi) {
+        $rd->{tarball_name} = "${dist}.tar.gz";
+        $rd->{tarball_url}  = $expect_url;
+        $error = 0;
+    }
+    return ($error, $rd);
+}
+
+sub release_detail {
+    my ($self, $dist) = @_;
+    my ($dist_type, $dist_version, $tarball_name, $tarball_url);
+
+    ($dist_type, $dist_version) = $dist =~ /^ (?: (c?perl) -? )? ( [\d._]+ 
(?:-RC\d+)? |git|stable|blead)$/x;
+    $dist_type = "perl" if $dist_version && !$dist_type;
+
+    my $rd = {
+        type => $dist_type,
+        version => $dist_version,
+        tarball_url => undef,
+        tarball_name => undef,
+    };
+
+    my $m_local = "release_detail_${dist_type}_local";
+    my $m_remote = "release_detail_${dist_type}_remote";
+
+    my ($error) = $self->$m_local($dist, $rd);
+    ($error) = $self->$m_remote($dist, $rd) if $error;
+
+    if ($error) {
+        die "ERROR: Fail to get the tarball URL for dist: $dist\n";
+    }
+
+    return $rd;
 }
 
 sub run_command_init {
@@ -952,6 +1095,11 @@
     # Note that this is incorrect for blead.
     my $extracted_dir = "@{[ $self->root ]}/build/$dist_tarball_basename";
 
+    # cperl tarball contains a dir name like: cperl-cperl-5.22.1
+    if ($dist_tarball_basename =~ /^cperl-/) {
+        $extracted_dir = "@{[ $self->root ]}/build/${dist_tarball_basename}";
+    }
+
     # Was broken on Solaris, where GNU tar is probably
     # installed as 'gtar' - RT #61042
     my $tarx =
@@ -1028,7 +1176,13 @@
 sub do_install_release {
     my ($self, $dist, $dist_version) = @_;
 
-    my ($dist_tarball, $dist_tarball_url) = $self->perl_release($dist_version);
+    my $rd = $self->release_detail($dist);
+    my $dist_type = $rd->{type};
+
+    die "\"$dist\" does not look like a perl distribution name. " unless 
$dist_type && $dist_version =~ /^\d\./;
+
+    my $dist_tarball = $rd->{tarball_name};
+    my $dist_tarball_url = $rd->{tarball_url};
     my $dist_tarball_path = joinpath($self->root, "dists", $dist_tarball);
 
     if (-f $dist_tarball_path) {
@@ -1056,20 +1210,23 @@
     $self->{dist_name} = $dist; # for help msg generation, set to non
                                 # normalized name
 
-    if ($dist =~ /^(?:perl-?)?([\d._]+(?:-RC\d+)?|git|stable|blead)$/) {
-        my $version = ($1 eq 'stable' ? $self->resolve_stable_version : $1);
-        $dist = "perl-$version"; # normalize dist name
+    my ($dist_type, $dist_version);
+    if ( ($dist_type, $dist_version) = $dist =~ 
/^(?:(c?perl)-?)?([\d._]+(?:-RC\d+)?|git|stable|blead)$/ ) {
+        my $dist_version = ($dist_version eq 'stable' ? 
$self->resolve_stable_version : $2);
+        $dist_version = $self->resolve_stable_version if $dist_version eq 
'stable';
+        $dist_type ||= "perl";
+        $dist = "${dist_type}-${dist_version}"; # normalize dist name
 
         my $installation_name = ($self->{as} || $dist) . $self->{variation} . 
$self->{append};
         if (not $self->{force} and $self->is_installed( $installation_name )) {
             die "\nABORT: $installation_name is already installed.\n\n";
         }
 
-        if ($version eq 'blead') {
+        if ( $dist_type eq 'perl' && $dist_version eq 'blead') {
             $self->do_install_blead($dist);
         }
         else {
-            $self->do_install_release( $dist, $version );
+            $self->do_install_release( $dist, $dist_version );
         }
 
     }
@@ -1203,11 +1360,10 @@
     $dist = $self->resolve_stable_version
         if $dist && $dist eq 'stable';
 
-    my ($dist_version) = $dist =~ /^ (?:perl-?)? (.*) $/xs;
-
-    die "\"$dist\" does not look like a perl distribution name. " unless 
$dist_version =~ /^\d\./;
+    my $rd = $self->release_detail($dist);
 
-    my ($dist_tarball, $dist_tarball_url) = $self->perl_release($dist_version);
+    my $dist_tarball = $rd->{tarball_name};
+    my $dist_tarball_url = $rd->{tarball_url};
     my $dist_tarball_path = joinpath($self->root, "dists", $dist_tarball);
 
     if (-f $dist_tarball_path && !$self->{force}) {
@@ -1278,9 +1434,10 @@
     my $dist_version;
     my $installation_name;
 
-    if (File::Basename::basename($dist_tarball_path) =~ 
m{perl-?(5.+)\.tar\.(gz|bz2)\Z}) {
-        $dist_version = $1;
-        $installation_name = "perl-${dist_version}";
+    if (File::Basename::basename($dist_tarball_path) =~ 
m{(c?perl)-?(5.+)\.tar\.(gz|bz2)\Z}) {
+        my $perl_variant = $1;
+        $dist_version = $2;
+        $installation_name = "${perl_variant}-${dist_version}";
     }
 
     unless ($dist_version && $installation_name) {
@@ -1297,6 +1454,7 @@
 
     my $variation = $self->{variation};
     my $append = $self->{append};
+    my $looks_like_we_are_installing_cperl =  $dist_extracted_dir =~ /\/ 
cperl- /x;
 
     $self->{dist_extracted_dir} = $dist_extracted_dir;
     $self->{log_file} = joinpath($self->root, 
"build.${installation_name}${variation}${append}.log");
@@ -1335,14 +1493,16 @@
     unshift @d_options, qq(prefix=$perlpath);
     push @d_options, "usedevel" if $dist_version =~ /5\.\d[13579]|git|blead/;
 
-    unless (grep { /eval:scriptdir=/} @a_options) {
-        push @a_options, "'eval:scriptdir=${perlpath}/bin'";
-    }
+    push @d_options, "usecperl" if $looks_like_we_are_installing_cperl;
 
     my $version = perl_version_to_integer($dist_version);
     if (defined $version and $version < perl_version_to_integer( '5.6.0' ) ) {
         # ancient perls do not support -A for Configure
         @a_options = ();
+    } else {
+        unless (grep { /eval:scriptdir=/} @a_options) {
+            push @a_options, "'eval:scriptdir=${perlpath}/bin'";
+        }
     }
 
     print "Installing $dist_extracted_dir into " . $self->path_with_tilde("@{[ 
$self->root ]}/perls/$installation_name") . "\n\n";
@@ -1357,7 +1517,7 @@
         "cd $dist_extracted_dir",
         "rm -f config.sh Policy.sh",
     );
-    push @preconfigure_commands, $patchperl unless $self->{"no-patchperl"};
+    push @preconfigure_commands, $patchperl unless $self->{"no-patchperl"} || 
$looks_like_we_are_installing_cperl;
 
     my $configure_flags = $self->env("PERLBREW_CONFIGURE_FLAGS") || '-de';
 
@@ -1424,12 +1584,9 @@
         if ( $sitecustomize ) {
             my $capture = $self->do_capture("$newperl -V:sitelib");
             my ($sitelib) = $capture =~ m/sitelib='([^']*)';/;
-            # This should probably all use File::Path
-            if ($destdir) {
-                $sitelib = $destdir . $sitelib
-            }
+            $sitelib = $destdir . $sitelib if $destdir;
             mkpath($sitelib) unless -d $sitelib;
-            my $target = "$sitelib/sitecustomize.pl";
+            my $target = joinpath($sitelib, "sitecustomize.pl");
             open my $dst, ">", $target
                 or die "Could not open '$target' for writing: $!\n";
             open my $src, "<", $sitecustomize
@@ -1881,7 +2038,9 @@
     for my $perl (@perls) {
         for my $executable (<$root/perls/$perl/bin/*>) {
             my ($name, $version) = $executable =~ m/bin\/(.+?)(5\.\d.*)?$/;
-            system("ln -fs $executable $root/perls/$perl/bin/$name") if 
$version;
+            next unless $version;
+            system("ln -fs $executable $root/perls/$perl/bin/$name");
+            system("ln -fs $executable $root/perls/$perl/bin/perl") if $name 
eq "cperl";
         }
     }
 }
@@ -2843,7 +3002,7 @@
 =head2 SYNOPSIS
 
     # Installation
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
     # Initialize
     perlbrew init
@@ -2889,7 +3048,7 @@
 
 For the documentation of perlbrew usage see L<perlbrew> command
 on L<MetaCPAN|https://metacpan.org/>, or by running C<perlbrew help>,
-or by visiting L<perlbrew's official website|http://perlbrew.pl/>. The 
following documentation
+or by visiting L<perlbrew's official website|https://perlbrew.pl/>. The 
following documentation
 features the API of C<App::perlbrew> module, and may not be remotely
 close to what your want to read.
 
@@ -2898,11 +3057,11 @@
 It is the simplest to use the perlbrew installer, just paste this statement to
 your terminal:
 
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
 Or this one, if you have C<fetch> (default on FreeBSD):
 
-    fetch -o- http://install.perlbrew.pl | sh
+    fetch -o- https://install.perlbrew.pl | sh
 
 After that, C<perlbrew> installs itself to C<~/perl5/perlbrew/bin>, and you
 should follow the instruction on screen to modify your shell rc file to put it
@@ -2922,7 +3081,7 @@
 environment variable before running the installer:
 
     export PERLBREW_ROOT=/opt/perl5
-    curl -L http://install.perlbrew.pl | bash
+    curl -L https://install.perlbrew.pl | bash
 
 As a result, different users on the same machine can all share the same 
perlbrew
 root directory (although only original user that made the installation would
@@ -2968,8 +3127,8 @@
 
 =head2 PROJECT DEVELOPMENT
 
-L<perlbrew project|http://perlbrew.pl/> uses github
-L<http://github.com/gugod/App-perlbrew/issues> and RT
+L<perlbrew project|https://perlbrew.pl/> uses github
+L<https://github.com/gugod/App-perlbrew/issues> and RT
 <https://rt.cpan.org/Dist/Display.html?Queue=App-perlbrew> for issue
 tracking. Issues sent to these two systems will eventually be reviewed
 and handled.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/t/16.release-detail.t 
new/App-perlbrew-0.76/t/16.release-detail.t
--- old/App-perlbrew-0.75/t/16.release-detail.t 1970-01-01 01:00:00.000000000 
+0100
+++ new/App-perlbrew-0.76/t/16.release-detail.t 2016-06-21 23:05:21.000000000 
+0200
@@ -0,0 +1,53 @@
+#!perl
+use strict;
+use App::perlbrew;
+use File::Temp qw( tempdir );
+$App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = tempdir( CLEANUP => 1 );
+$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT;
+
+use Test::More;
+
+subtest 'parse "perl-5.18.2"' => sub {
+    my $app = App::perlbrew->new();
+
+    my $rd = $app->release_detail("perl-5.18.2");
+
+    ok defined( $rd->{type} );
+    ok defined( $rd->{version} );
+    ok defined( $rd->{tarball_url} );
+    ok defined( $rd->{tarball_name} );
+
+    is $rd->{type}, "perl";
+    is $rd->{version}, "5.18.2";
+};
+
+subtest 'parse "5.18.2"' => sub {
+    my $app = App::perlbrew->new();
+
+    my $rd = $app->release_detail("5.18.2");
+
+    ok defined( $rd->{type} );
+    ok defined( $rd->{version} );
+    ok defined( $rd->{tarball_url} );
+    ok defined( $rd->{tarball_name} );
+
+    is $rd->{type}, "perl";
+    is $rd->{version}, "5.18.2";
+};
+
+subtest 'parse "cperl-5.22.2"' => sub {
+    my $app = App::perlbrew->new();
+
+    my $rd = $app->release_detail("cperl-5.22.2");
+
+    ok defined( $rd->{type} );
+    ok defined( $rd->{version} );
+    ok defined( $rd->{tarball_url} );
+    ok defined( $rd->{tarball_name} );
+
+    is $rd->{type}, "cperl";
+    is $rd->{version}, "5.22.2";
+};
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/t/17.release-detail-cperl-local.t 
new/App-perlbrew-0.76/t/17.release-detail-cperl-local.t
--- old/App-perlbrew-0.75/t/17.release-detail-cperl-local.t     1970-01-01 
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.76/t/17.release-detail-cperl-local.t     2016-06-21 
23:05:21.000000000 +0200
@@ -0,0 +1,22 @@
+#!perl
+use strict;
+use App::perlbrew;
+use File::Temp qw( tempdir );
+$App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = tempdir( CLEANUP => 1 );
+$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT;
+
+use Test::More;
+
+my $app = App::perlbrew->new();
+
+my $rd = { type => "cperl", "version" => "5.22.2" };
+$app->release_detail_cperl_local("cperl-5.22.2", $rd);
+
+ok defined( $rd->{tarball_url} );
+ok defined( $rd->{tarball_name} );
+
+is $rd->{tarball_url}, 
"https://github.com/perl11/cperl/releases/download/cperl-5.22.2/cperl-5.22.2.tar.gz";;
+is $rd->{tarball_name}, "cperl-5.22.2.tar.gz";
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/t/17.release-detail-cperl-remote.t 
new/App-perlbrew-0.76/t/17.release-detail-cperl-remote.t
--- old/App-perlbrew-0.75/t/17.release-detail-cperl-remote.t    1970-01-01 
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.76/t/17.release-detail-cperl-remote.t    2016-06-21 
23:05:21.000000000 +0200
@@ -0,0 +1,26 @@
+#!perl
+use strict;
+use App::perlbrew;
+use File::Temp qw( tempdir );
+$App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = tempdir( CLEANUP => 1 );
+$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT;
+
+use Test::More;
+
+unless ($ENV{TEST_LIVE}) {
+    plan skip_all => 'These tests send HTTP requests. Set env TEST_LIVE=1 to 
really run them.';
+}
+
+my $app = App::perlbrew->new();
+
+my $rd = { type => "cperl", "version" => "5.22.2" };
+$app->release_detail_cperl_remote("cperl-5.22.2", $rd);
+
+ok defined( $rd->{tarball_url} );
+ok defined( $rd->{tarball_name} );
+
+is $rd->{tarball_url}, 
"https://github.com/perl11/cperl/releases/download/cperl-5.22.2/cperl-5.22.2.tar.gz";;
+is $rd->{tarball_name}, "cperl-5.22.2.tar.gz";
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/t/18.release-detail-perl-local.t 
new/App-perlbrew-0.76/t/18.release-detail-perl-local.t
--- old/App-perlbrew-0.75/t/18.release-detail-perl-local.t      1970-01-01 
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.76/t/18.release-detail-perl-local.t      2016-06-21 
23:05:21.000000000 +0200
@@ -0,0 +1,24 @@
+#!perl
+use strict;
+use App::perlbrew;
+use File::Temp qw( tempdir );
+$App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = tempdir( CLEANUP => 1 );
+$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT;
+
+use Test::More;
+
+my $app = App::perlbrew->new();
+$app->cpan_mirror("http://www.cpan.org";);
+
+my $rd = { type => "perl", "version" => "5.18.2" };
+my ($error, undef) = $app->release_detail_perl_local("perl-5.18.2", $rd);
+
+ok !$error;
+ok defined( $rd->{tarball_url} );
+ok defined( $rd->{tarball_name} );
+
+is $rd->{tarball_url}, 
"http://www.cpan.org/authors/id/R/RJ/RJBS/perl-5.18.2.tar.bz2";;
+is $rd->{tarball_name}, "perl-5.18.2.tar.bz2";
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/t/18.release-detail-perl-remote.t 
new/App-perlbrew-0.76/t/18.release-detail-perl-remote.t
--- old/App-perlbrew-0.75/t/18.release-detail-perl-remote.t     1970-01-01 
01:00:00.000000000 +0100
+++ new/App-perlbrew-0.76/t/18.release-detail-perl-remote.t     2016-06-21 
23:05:21.000000000 +0200
@@ -0,0 +1,28 @@
+#!perl
+use strict;
+use App::perlbrew;
+use File::Temp qw( tempdir );
+$App::perlbrew::PERLBREW_ROOT = tempdir( CLEANUP => 1 );
+$App::perlbrew::PERLBREW_HOME = tempdir( CLEANUP => 1 );
+$ENV{PERLBREW_ROOT} = $App::perlbrew::PERLBREW_ROOT;
+
+use Test::More;
+
+unless ($ENV{TEST_LIVE}) {
+    plan skip_all => 'These tests send HTTP requests. Set env TEST_LIVE=1 to 
really run them.';
+}
+
+my $app = App::perlbrew->new();
+$app->cpan_mirror("http://www.cpan.org";);
+
+my $rd = { type => "perl", "version" => "5.18.2" };
+my ($error, undef) = $app->release_detail_perl_remote("perl-5.18.2", $rd);
+
+ok !$error;
+ok defined( $rd->{tarball_url} );
+ok defined( $rd->{tarball_name} );
+
+is $rd->{tarball_url}, "http://www.cpan.org/src/5.0/perl-5.18.2.tar.bz2";;
+is $rd->{tarball_name}, "perl-5.18.2.tar.bz2";
+
+done_testing;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/App-perlbrew-0.75/t/http.t 
new/App-perlbrew-0.76/t/http.t
--- old/App-perlbrew-0.75/t/http.t      2015-02-01 10:09:41.000000000 +0100
+++ new/App-perlbrew-0.76/t/http.t      2016-06-21 23:05:21.000000000 +0200
@@ -22,7 +22,7 @@
 
     before all => sub {
         App::perlbrew::http_get(
-            "http://get.perlbrew.pl";,
+            "https://get.perlbrew.pl";,
             undef,
             sub { $output = $_[0]; }
         );
@@ -34,7 +34,7 @@
 
     it "seems to download the correct content", sub {
         ok $output =~ m<\A #!/usr/bin/perl\n >x;
-        ok $output =~ m< \$fatpacked{"App/perlbrew.pm"} >x;
+        ok $output =~ m< \$fatpacked\{"App/perlbrew.pm"\} >x;
     };
 };
 
@@ -55,7 +55,7 @@
 REASON
         }
 
-        my $download_error = 
App::perlbrew::http_download("http://install.perlbrew.pl";, $output);
+        my $download_error = 
App::perlbrew::http_download("https://install.perlbrew.pl";, $output);
     };
 
     it "downloads to the wanted path" => sub {


Reply via email to