This is an automated email from the git hooks/post-receive script.

abe pushed a commit to annotated tag 0.2.2-source
in repository libdist-zilla-role-bootstrap-perl.

commit 4b932294bc9e6c3582a1e149d97a8a6ebe781c97
Author: Kent Fredric <kentfred...@gmail.com>
Date:   Fri Oct 25 08:38:07 2013 +1300

    Further attempts at getting a sterile tree on 5.8
---
 sterilize_env.pl | 76 +++++++++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 61 insertions(+), 15 deletions(-)

diff --git a/sterilize_env.pl b/sterilize_env.pl
index 34bca35..91fb325 100644
--- a/sterilize_env.pl
+++ b/sterilize_env.pl
@@ -36,33 +36,79 @@ sub safe_exec {
   return 1;
 }
 
+sub cpanm {
+  my (@params) = @_;
+  my $exit_code = safe_exec_nonfatal( 'cpanm', @params );
+  if ( $exit_code != 0 ) {
+    safe_exec( 'tail', '-n', '200', '/home/travis/.cpanm/build.log' );
+    exit $exit_code;
+  }
+  return 1;
+}
+
+sub no_sterile_warning {
+  if ( env_is( 'TRAVIS_PERL_VERSION', '5.8' ) or env_is( 
'TRAVIS_PERL_VERSION', '5.10' ) ) {
+    diag("\e[31m TREE STERILIZATION IMPOSSIBLE <= 5.10\e[0m");
+    diag("\e[32m ... because prior to 5.11.*, dual-life installed to 
\e[33mprivlib\e[0m");
+    diag("\e[32m ... because prior to 5.11.*, \e[33m\@INC\e[32m order was 
\e[33mprivlib,sitelib\e[0m");
+    diag("\e[32m ... whereas after to 5.11.*, \e[33m\@INC\e[32m order is 
\e[33msitelib,privlib\e[0m");
+    diag("\e[32m ... and now most dual-life things simply install to 
\e[33msitelib\e[0m");
+    diag("\e[34m ( However, there are still a few naughty CPAN modules that 
install to \e[33mprivlib\e[34m )");
+    diag(
+      "\e[32m but the net effect of this is that installing 
\e[33mModule::Build 0.4007\e[32m which pulls \e[33mPerl::OSType\e[0m"
+    );
+    diag("\e[32m and results in  \e[33mPerl::OSType\e[32m being later removed 
\e[0m");
+    diag("\e[32m leaving behind a broken  \e[33mModule::Build 
0.4007\e[32m\e[0m");
+    diag("\e[34m Set \e[35m MAYBE_BREAK_MODULE_BUILD=1\e[34m if this is 
ok\e[0m");
+    exit 0 unless env_true('MAYBE_BREAK_MODULE_BUILD');
+    diag("\e[35m PROCEEDING\e[0m");
+  }
+
+}
+
 if ( not env_true('STERILIZE_ENV') ) {
   diag('STERILIZE_ENV unset or false, not sterilizing');
   exit 0;
 }
 
+my $extra_sterile = {
+  '5.8' => {
+    remove => [ 'Module/Build.pm', 'Module/Build/Base.pm', 
'Module/Build/Compat.pm', 'Module/Build/Cookbook.pm', 'autobox.pm' ],
+  },
+  '5.10' => {
+    remove => [ 'autobox.pm' ],
+    install => ['Module::Build~<0.340201'],
+  },
+};
+
 if ( not env_true('TRAVIS') ) {
   diag('Is not running under travis!');
   exit 1;
 }
-if ( env_is( 'TRAVIS_PERL_VERSION', '5.8' ) or env_is( 'TRAVIS_PERL_VERSION', 
'5.10' ) ) {
-  diag("\e[31m TREE STERILIZATION IMPOSSIBLE <= 5.10\e[0m");
-  diag("\e[32m ... because prior to 5.11.*, dual-life installed to 
\e[33mprivlib\e[0m");
-  diag("\e[32m ... because prior to 5.11.*, \e[33m\@INC\e[32m order was 
\e[33mprivlib,sitelib\e[0m");
-  diag("\e[32m ... whereas after to 5.11.*, \e[33m\@INC\e[32m order is 
\e[33msitelib,privlib\e[0m");
-  diag("\e[32m ... and now most dual-life things simply install to 
\e[33msitelib\e[0m");
-  diag("\e[34m ( However, there are still a few naughty CPAN modules that 
install to \e[33mprivlib\e[34m )");
-  diag(
-    "\e[32m but the net effect of this is that installing \e[33mModule::Build 
0.4007\e[32m which pulls \e[33mPerl::OSType\e[0m");
-  diag("\e[32m and results in  \e[33mPerl::OSType\e[32m being later removed 
\e[0m");
-  diag("\e[32m leaving behind a broken  \e[33mModule::Build 
0.4007\e[32m\e[0m");
-  diag("\e[34m Set \e[35m MAYBE_BREAK_MODULE_BUILD=1\e[34m if this is 
ok\e[0m");
-  exit 0 unless env_true('MAYBE_BREAK_MODULE_BUILD');
-  diag("\e[35m PROCEEDING\e[0m");
+
+for my $perl_ver ( keys %{$extra_sterile} ) {
+  if ( env_is( 'TRAVIS_PERL_VERSION', $perl_ver ) ) {
+    diag("Running custom sterilization fixups");
+    my $fixups = $extra_sterile->{$perl_ver};
+    if ( $fixups->{install} ) {
+      cpanm( '--quiet', '--notest', '--no-man-pages', $_ ) for @{ 
$fixups->{install} };
+    }
+    if ( $fixups->{remove} ) {
+      diag("Removing Bad things from all Config paths");
+      for my $libdir ( grep { $_ =~ /(lib|arch)exp$/ keys %Config } ) {
+        for my $removal ( @{ $fixups->{remove} } ) {
+          my $path = $libdir . '/' . $removal;
+          if ( -e -f $path ) {
+            unlink $path;
+            diag("Removed $path");
+          }
+        }
+      }
+    }
+  }
 }
 use Config;
 for my $libdir ( grep { $_ =~ /site(lib|arch)exp$/ } keys %Config ) {
   safe_exec( 'find', $Config{$libdir}, '-type', 'f', '-delete' );
   safe_exec( 'find', $Config{$libdir}, '-depth', '-type', 'd', '-delete' );
 }
-

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-perl/packages/libdist-zilla-role-bootstrap-perl.git

_______________________________________________
Pkg-perl-cvs-commits mailing list
Pkg-perl-cvs-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-perl-cvs-commits

Reply via email to