r73670 - in /trunk/perlbrew: ./ bin/ debian/ lib/App/ t/

ghedo-guest at users.alioth.debian.org ghedo-guest at users.alioth.debian.org
Wed Apr 27 19:16:42 UTC 2011


Author: ghedo-guest
Date: Wed Apr 27 19:16:22 2011
New Revision: 73670

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=73670
Log:
new upstream release

Added:
    trunk/perlbrew/t/03.test_get_available_versions.t
      - copied unchanged from r73654, branches/upstream/perlbrew/current/t/03.test_get_available_versions.t
    trunk/perlbrew/t/04.find_available_perls.t
      - copied unchanged from r73654, branches/upstream/perlbrew/current/t/04.find_available_perls.t
    trunk/perlbrew/t/04.test_uniq.t
      - copied unchanged from r73654, branches/upstream/perlbrew/current/t/04.test_uniq.t
    trunk/perlbrew/t/05.get_current_perl.t
      - copied unchanged from r73654, branches/upstream/perlbrew/current/t/05.get_current_perl.t
Modified:
    trunk/perlbrew/Changes
    trunk/perlbrew/LICENSE
    trunk/perlbrew/MANIFEST
    trunk/perlbrew/META.yml
    trunk/perlbrew/Makefile.PL
    trunk/perlbrew/bin/perlbrew
    trunk/perlbrew/debian/changelog
    trunk/perlbrew/debian/control
    trunk/perlbrew/debian/copyright
    trunk/perlbrew/lib/App/perlbrew.pm
    trunk/perlbrew/t/02.format_perl_version.t

Modified: trunk/perlbrew/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/Changes?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/Changes (original)
+++ trunk/perlbrew/Changes Wed Apr 27 19:16:22 2011
@@ -1,3 +1,10 @@
+0.19:
+- Auto run 'perlbrew init' after an install (or upgrade)
+- Symlink dev versions of executables. For example,'perl5.13.11' to 'perl', 'prove5.13.11' to 'prove'.
+- Automatically apply patches necessary to make older perls build again on
+  modern platforms with the help of Devel::PatchPerl.
+- A command "perlbrew available" to list recently available perls to build by trcjr
+
 0.18:
 - Spotted and fixed by chad.a.davis++, an issue when bash set "noclobber" option,
   which breaks the creation of ~/.perlbrew/init. See https://rt.cpan.org/Ticket/Display.html?id=66518

Modified: trunk/perlbrew/LICENSE
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/LICENSE?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/LICENSE (original)
+++ trunk/perlbrew/LICENSE Wed Apr 27 19:16:22 2011
@@ -1,6 +1,6 @@
 The MIT License
 
-Copyright (c) 2010 Kang-mil Liu
+Copyright (c) 2010,2011 Kang-min Liu
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Modified: trunk/perlbrew/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/MANIFEST?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/MANIFEST (original)
+++ trunk/perlbrew/MANIFEST Wed Apr 27 19:16:22 2011
@@ -21,3 +21,7 @@
 t/01.options.t
 t/02.format_perl_version.t
 t/03.path_with_tilde.t
+t/03.test_get_available_versions.t
+t/04.find_available_perls.t
+t/04.test_uniq.t
+t/05.get_current_perl.t

Modified: trunk/perlbrew/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/META.yml?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/META.yml (original)
+++ trunk/perlbrew/META.yml Wed Apr 27 19:16:22 2011
@@ -4,6 +4,8 @@
   - 'Kang-min Liu  C<< <gugod at gugod.org> >>'
 build_requires:
   ExtUtils::MakeMaker: 6.42
+  Test::More: 0
+  Test::Output: 0
   Test::Simple: 0
 configure_requires:
   ExtUtils::MakeMaker: 6.42
@@ -20,8 +22,9 @@
     - inc
     - t
 requires:
+  Devel::PatchPerl: 0.26
   perl: 5.8.0
 resources:
   license: http://opensource.org/licenses/mit-license.php
   repository: git://github.com/gugod/App-perlbrew.git
-version: 0.18
+version: 0.19

Modified: trunk/perlbrew/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/Makefile.PL?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/Makefile.PL (original)
+++ trunk/perlbrew/Makefile.PL Wed Apr 27 19:16:22 2011
@@ -48,7 +48,11 @@
 
 repository 'git://github.com/gugod/App-perlbrew.git';
 
+requires 'Devel::PatchPerl' => '0.26';
+
 test_requires 'Test::Simple';
+test_requires 'Test::More';
+test_requires 'Test::Output';
 
 install_script 'bin/perlbrew';
 

Modified: trunk/perlbrew/bin/perlbrew
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/bin/perlbrew?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/bin/perlbrew (original)
+++ trunk/perlbrew/bin/perlbrew Wed Apr 27 19:16:22 2011
@@ -115,6 +115,24 @@
 You can also ask for the proper variables for a specific perl version.
 
 
+=item B<symlink_executables> <perl-version>
+
+Low-level command. Use this command to create the C<perl> executable
+symbolic link to C<perl5.13.6>.
+
+You don't need to do this unless you were using old perlbrew to
+install perls. The installation layout is changed since version 0.11.
+
+If you just upgraded perlbrew and found C<perlbrew switch> failed to work
+after you switch to a development release of perl, say, perl-5.13.6, run this command:
+
+    perlbrew symlink_executables perl-5.13.6
+
+This essentially creates this symlink:
+
+   ${PERLBREW_ROOT}/perls/perl-5.13.6/bin/perl
+   -> ${PERLBREW_ROOT}/perls/perl-5.13.6/bin/perl5.13.6
+
 =item B<install-cpanm>
 
 Install the C<cpanm> standalone executable in C<$PERLBREW_ROOT/bin>.

Modified: trunk/perlbrew/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/debian/changelog?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/debian/changelog (original)
+++ trunk/perlbrew/debian/changelog Wed Apr 27 19:16:22 2011
@@ -1,3 +1,15 @@
+perlbrew (0.19-1) UNRELEASED; urgency=low
+
+  WAITS-FOR: libdevel-patchperl-perl
+
+  * New upstream release
+  * Update dependencies:
+    - (Build-)Depends(-Indep) on libdevel-patchperl-perl
+    - B-D-I on libtest-output-perl
+  * Update upstream copyright years
+
+ -- Alessandro Ghedini <al3xbio at gmail.com>  Wed, 27 Apr 2011 20:49:57 +0200
+
 perlbrew (0.18-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/perlbrew/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/debian/control?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/debian/control (original)
+++ trunk/perlbrew/debian/control Wed Apr 27 19:16:22 2011
@@ -2,7 +2,9 @@
 Section: perl
 Priority: optional
 Build-Depends: debhelper (>= 8)
-Build-Depends-Indep: perl
+Build-Depends-Indep: perl,
+ libdevel-patchperl-perl,
+ libtest-output-perl
 Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
 Uploaders: Alessandro Ghedini <al3xbio at gmail.com>
 Standards-Version: 3.9.1
@@ -12,7 +14,8 @@
 
 Package: perlbrew
 Architecture: all
-Depends: ${misc:Depends}, ${perl:Depends}
+Depends: ${misc:Depends}, ${perl:Depends},
+ libdevel-patchperl-perl
 Description: script to manage perl installations in your $HOME
  perlbrew is a program to automate the building and installation of perl
  in the users HOME. At the moment, it installs everything to ~/perl5/perlbrew,

Modified: trunk/perlbrew/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/debian/copyright?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/debian/copyright (original)
+++ trunk/perlbrew/debian/copyright Wed Apr 27 19:16:22 2011
@@ -4,7 +4,7 @@
 Name: App-perlbrew
 
 Files: *
-Copyright: 2010, Kang-min Liu <gugod at gugod.org>
+Copyright: 2010-2011, Kang-min Liu <gugod at gugod.org>
 License: MIT
 
 Files: inc/Module/*

Modified: trunk/perlbrew/lib/App/perlbrew.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/lib/App/perlbrew.pm?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/lib/App/perlbrew.pm (original)
+++ trunk/perlbrew/lib/App/perlbrew.pm Wed Apr 27 19:16:22 2011
@@ -5,7 +5,7 @@
 use Getopt::Long ();
 use File::Spec::Functions qw( catfile );
 
-our $VERSION = "0.18";
+our $VERSION = "0.19";
 our $CONF;
 
 my $ROOT         = $ENV{PERLBREW_ROOT} || "$ENV{HOME}/perl5/perlbrew";
@@ -20,15 +20,13 @@
     source $HOME/.perlbrew/init
 fi
 
-short_option=""
-
 __perlbrew_reinit () {
     if [[ ! -d $HOME/.perlbrew ]]; then
         mkdir -p $HOME/.perlbrew
     fi
 
     echo '# DO NOT EDIT THIS FILE' >| $HOME/.perlbrew/init
-    command perlbrew $short_option env $1 >> $HOME/.perlbrew/init
+    command perlbrew env $1 >> $HOME/.perlbrew/init
     source $HOME/.perlbrew/init
     __perlbrew_set_path
 }
@@ -43,11 +41,14 @@
 
 perlbrew () {
     local exit_status
+    local short_option
     export SHELL
 
     if [[ `echo $1 | awk 'BEGIN{FS=""}{print $1}'` = '-' ]]; then
         short_option=$1
         shift
+    else
+        short_option=""
     fi
 
     case $1 in
@@ -305,6 +306,44 @@
     Pod::Usage::pod2usage(-verbose => $verbose||0, -exitval => (defined $status ? $status : 1));
 }
 
+sub run_command_available {
+    my ( $self, $dist, $opts ) = @_;
+
+    my @available = $self->get_available_perls(@_);
+    my @installed = $self->installed_perls(@_);
+
+    my $is_installed;
+    for my $available (@available) {
+        $is_installed = 0;
+        for my $installed (@installed) {
+            my $name = $installed->{name};
+            my $cur  = $installed->{is_current};
+            if ( $available eq $installed->{name} ) {
+                $is_installed = 1;
+                last;
+            }
+        }
+        print $is_installed ? 'i ' : '  ', $available, "\n";
+    }
+}
+
+sub get_available_perls {
+    my ( $self, $dist, $opts ) = @_;
+
+    my $url = "http://www.cpan.org/src/README.html";
+    my $html = http_get( $url, undef, undef );
+
+    my @available_versions;
+
+    for ( split "\n", $html ) {
+        push @available_versions, $1
+          if m|<td><a href="http://www.cpan.org/src/.+?">(.+?)</a></td>|;
+    }
+    s/\.tar\.gz// for @available_versions;
+
+    return @available_versions;
+}
+
 sub run_command_init {
     my $self = shift;
     my $HOME = $self->env('HOME');
@@ -331,7 +370,7 @@
         $shrc = $yourshrc = 'bashrc';
     }
 
-    system("$0 env > ${HOME}/.perlbrew/init");
+    system("$0 env @{[ $self->current_perl ]}> ${HOME}/.perlbrew/init");
 
     my $root_dir = $self->path_with_tilde($ROOT);
 
@@ -340,22 +379,12 @@
 
     $root_dir
 
-Well-done! Congratulations! Please add the following line to the end
-of your ~/.${yourshrc}
+Paste the following line to the end of your ~/.${yourshrc} and start a
+new shell, perlbrew should be up and fully functional from there:
 
     source $root_dir/etc/${shrc}
 
-After that, exit this shell, start a new one, and install some fresh
-perls:
-
-    perlbrew install perl-5.12.1
-    perlbrew install perl-5.10.1
-
-For further instructions, simply run:
-
-    perlbrew
-
-The default help messages will popup and tell you what to do!
+For further instructions, simply run `perlbrew` to see de help message.
 
 Enjoy perlbrew at \$HOME!!
 INSTRUCTION
@@ -393,13 +422,9 @@
 
 You may trash the downloaded $executable from now on.
 
-Next, if this is the first time you install perlbrew, run:
-
-    $path init
-
-And follow the instruction on screen.
 HELP
 
+        $self->run_command_init();
         return;
     }
 
@@ -511,6 +536,7 @@
             $extract_command,
             "cd $dist_extracted_dir",
             "rm -f config.sh Policy.sh",
+            "patchperl",
             "sh Configure $configure_flags " .
                 join( ' ',
                     ( map { qq{'-D$_'} } @d_options ),
@@ -533,6 +559,10 @@
         delete $ENV{$_} for qw(PERL5LIB PERL5OPT);
 
         if (!system($cmd)) {
+            unless (-e "$ROOT/perls/$as/bin/perl") {
+                $self->run_command_symlink_executables($as);
+            }
+
             print <<SUCCESS;
 Installed $dist as $as successfully. Run the following command to switch to it.
 
@@ -756,7 +786,14 @@
 }
 
 sub run_command_symlink_executables {
-    ## Ignore it silently for now
+    my($self, $perl) = @_;
+
+    return "" unless $perl;
+
+    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;
+    }
 }
 
 sub run_command_install_cpanm {
@@ -859,6 +896,9 @@
 
     # Pick a preferred CPAN mirror
     perlbrew mirror
+
+    # See what is available
+    perlbrew available
 
     # Install some Perls
     perlbrew install perl-5.12.2
@@ -981,7 +1021,7 @@
 
 =head1 COPYRIGHT
 
-Copyright (c) 2010, Kang-min Liu C<< <gugod at gugod.org> >>.
+Copyright (c) 2010, 2011 Kang-min Liu C<< <gugod at gugod.org> >>.
 
 =head1 LICENCE
 
@@ -995,7 +1035,7 @@
 Jesse Leuhrs, Andrew Rodland, Justin Davis, Masayoshi Sekimura,
 castaway, jrockway, chromatic, Goro Fuji, Sawyer X, Danijel Tasov,
 polettix, tokuhirom, Ævar Arnfjörð Bjarmason, Pedro Melo,
-Chad A Davis, dagolden.
+Chad A Davis, dagolden, trcjr, rafl.
 
 =head1 DISCLAIMER OF WARRANTY
 

Modified: trunk/perlbrew/t/02.format_perl_version.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/perlbrew/t/02.format_perl_version.t?rev=73670&op=diff
==============================================================================
--- trunk/perlbrew/t/02.format_perl_version.t (original)
+++ trunk/perlbrew/t/02.format_perl_version.t Wed Apr 27 19:16:22 2011
@@ -22,12 +22,12 @@
     },
 );
 
+plan tests => scalar @test_cases;
 {
     my $app = App::perlbrew->new();
-  TEST:
+ TEST:
     foreach my $test (@test_cases) {
         is( $app->format_perl_version( $test->{raw} ),
             $test->{parsed}, "$test->{raw} -> $test->{parsed}" );
     }
-    done_testing();
 }




More information about the Pkg-perl-cvs-commits mailing list