[libmoosex-has-sugar-perl] 108/120: Ditch all this shit, try newer sterile technique

Intrigeri intrigeri at moszumanska.debian.org
Wed Aug 27 21:35:15 UTC 2014


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

intrigeri pushed a commit to annotated tag 0.05070422-source
in repository libmoosex-has-sugar-perl.

commit 2395d4413a1aa9890a83e10ac04809c90f1f628d
Author: Kent Fredric <kentfredric at gmail.com>
Date:   Tue Nov 5 01:14:12 2013 +1300

    Ditch all this shit, try newer sterile technique
---
 corelist-data/5.008009.zsv          | Bin 7757 -> 0 bytes
 corelist-data/5.008009_skip.zsv     | Bin 43 -> 0 bytes
 corelist-data/5.010001.zsv          | Bin 14349 -> 0 bytes
 corelist-data/5.010001_skip.zsv     | Bin 62 -> 0 bytes
 corelist-data/5.012005.zsv          | Bin 14552 -> 0 bytes
 corelist-data/5.012005_skip.zsv     | Bin 137 -> 0 bytes
 corelist-data/5.014004.zsv          | Bin 15745 -> 0 bytes
 corelist-data/5.014004_skip.zsv     | Bin 62 -> 0 bytes
 corelist-data/5.016003.zsv          | Bin 16777 -> 0 bytes
 corelist-data/5.016003_skip.zsv     | Bin 56 -> 0 bytes
 corelist-data/5.017007.zsv          | Bin 16831 -> 0 bytes
 corelist-data/5.018000.zsv          | Bin 16864 -> 0 bytes
 corelist-data/5.018000_skip.zsv     | Bin 99 -> 0 bytes
 corelist-data/5.019000.zsv          | Bin 15065 -> 0 bytes
 corelist-data/5.019000_skip.zsv     | Bin 99 -> 0 bytes
 corelist-data/gen_modules.pl        |  20 ------
 corelist-data/gen_modules_travis.sh |   3 -
 corelist-data/gen_perl.pl           |  27 --------
 corelist-data/modules.zsv           | Bin 15369 -> 0 bytes
 lib/tools.pm                        |  49 ++++++++++++++
 sterilize_env.pl                    | 130 +-----------------------------------
 21 files changed, 50 insertions(+), 179 deletions(-)

diff --git a/corelist-data/5.008009.zsv b/corelist-data/5.008009.zsv
deleted file mode 100644
index 6911e5d..0000000
Binary files a/corelist-data/5.008009.zsv and /dev/null differ
diff --git a/corelist-data/5.008009_skip.zsv b/corelist-data/5.008009_skip.zsv
deleted file mode 100644
index f5be53c..0000000
Binary files a/corelist-data/5.008009_skip.zsv and /dev/null differ
diff --git a/corelist-data/5.010001.zsv b/corelist-data/5.010001.zsv
deleted file mode 100644
index f950a22..0000000
Binary files a/corelist-data/5.010001.zsv and /dev/null differ
diff --git a/corelist-data/5.010001_skip.zsv b/corelist-data/5.010001_skip.zsv
deleted file mode 100644
index fbab4bb..0000000
Binary files a/corelist-data/5.010001_skip.zsv and /dev/null differ
diff --git a/corelist-data/5.012005.zsv b/corelist-data/5.012005.zsv
deleted file mode 100644
index dc3143b..0000000
Binary files a/corelist-data/5.012005.zsv and /dev/null differ
diff --git a/corelist-data/5.012005_skip.zsv b/corelist-data/5.012005_skip.zsv
deleted file mode 100644
index 6aeaca2..0000000
Binary files a/corelist-data/5.012005_skip.zsv and /dev/null differ
diff --git a/corelist-data/5.014004.zsv b/corelist-data/5.014004.zsv
deleted file mode 100644
index 93abcac..0000000
Binary files a/corelist-data/5.014004.zsv and /dev/null differ
diff --git a/corelist-data/5.014004_skip.zsv b/corelist-data/5.014004_skip.zsv
deleted file mode 100644
index fbab4bb..0000000
Binary files a/corelist-data/5.014004_skip.zsv and /dev/null differ
diff --git a/corelist-data/5.016003.zsv b/corelist-data/5.016003.zsv
deleted file mode 100644
index 16222b6..0000000
Binary files a/corelist-data/5.016003.zsv and /dev/null differ
diff --git a/corelist-data/5.016003_skip.zsv b/corelist-data/5.016003_skip.zsv
deleted file mode 100644
index cccbafe..0000000
Binary files a/corelist-data/5.016003_skip.zsv and /dev/null differ
diff --git a/corelist-data/5.017007.zsv b/corelist-data/5.017007.zsv
deleted file mode 100644
index 2baf34b..0000000
Binary files a/corelist-data/5.017007.zsv and /dev/null differ
diff --git a/corelist-data/5.018000.zsv b/corelist-data/5.018000.zsv
deleted file mode 100644
index 06973c3..0000000
Binary files a/corelist-data/5.018000.zsv and /dev/null differ
diff --git a/corelist-data/5.018000_skip.zsv b/corelist-data/5.018000_skip.zsv
deleted file mode 100644
index d27ca97..0000000
Binary files a/corelist-data/5.018000_skip.zsv and /dev/null differ
diff --git a/corelist-data/5.019000.zsv b/corelist-data/5.019000.zsv
deleted file mode 100644
index 8447844..0000000
Binary files a/corelist-data/5.019000.zsv and /dev/null differ
diff --git a/corelist-data/5.019000_skip.zsv b/corelist-data/5.019000_skip.zsv
deleted file mode 100644
index d27ca97..0000000
Binary files a/corelist-data/5.019000_skip.zsv and /dev/null differ
diff --git a/corelist-data/gen_modules.pl b/corelist-data/gen_modules.pl
deleted file mode 100644
index 19d892c..0000000
--- a/corelist-data/gen_modules.pl
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env perl 
-use strict;
-use warnings;
-use utf8;
-
-open my $fh, '>', './modules.zsv';
-
-use Module::CoreList;
-
-my $seen_modules = {};
-
-for my $version ( sort keys %Module::CoreList::version ) {
-  my ($hash) = $Module::CoreList::version{$version};
-  for my $module ( sort keys %{$hash} ) {
-    next if exists $seen_modules->{$module};
-    $fh->printf( "%s\0\n", $module );
-    $seen_modules->{$module}++;
-  }
-}
-
diff --git a/corelist-data/gen_modules_travis.sh b/corelist-data/gen_modules_travis.sh
deleted file mode 100644
index 16d8028..0000000
--- a/corelist-data/gen_modules_travis.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-for i in 5.010001 5.012005 5.014004 5.016003 5.017007 5.018000 5.019000 5.008009; do
-  perl ./gen_perl.pl $i;
-done
diff --git a/corelist-data/gen_perl.pl b/corelist-data/gen_perl.pl
deleted file mode 100644
index d0678a4..0000000
--- a/corelist-data/gen_perl.pl
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env perl 
-use strict;
-use warnings;
-use utf8;
-
-use Module::CoreList;
-
-if ( not $ARGV[0] ) {
-  die "GIVE US A PERL VERSION";
-}
-
-my $version = $ARGV[0];
-
-use Module::CoreList;
-
-if ( not exists $Module::CoreList::version{$version} ) {
-  die "Version $version not in corelist";
-}
-my ($hash) = $Module::CoreList::version{$version};
-
-open my $fh, '>', './' . $version . '.zsv';
-
-for my $module ( sort keys %{$hash} ) {
-  $fh->printf( "%s\0%s\0\n", $module, $hash->{$module} );
-}
-$fh->close;
-
diff --git a/corelist-data/modules.zsv b/corelist-data/modules.zsv
deleted file mode 100644
index 311a703..0000000
Binary files a/corelist-data/modules.zsv and /dev/null differ
diff --git a/lib/tools.pm b/lib/tools.pm
index 12a57d0..da14e63 100644
--- a/lib/tools.pm
+++ b/lib/tools.pm
@@ -4,6 +4,7 @@ use warnings;
 package tools;
 
 use Cwd qw(cwd);
+use Config;
 
 sub diag {
   my $handle = \*STDERR;
@@ -76,6 +77,53 @@ sub get_fixes {
   $got_fixes = 1;
 }
 
+my $got_sterile;
+
+sub get_sterile {
+  return if $got_sterile;
+  my $cwd = cwd();
+  chdir '/tmp';
+  my $version = $[;
+  safe_exec(
+    'git', 'clone', '--depth=10',
+    '--branch=' . $version,
+    'https://github.com/kentfredric/perl5-sterile.git',
+    'perl5-sterile'
+  );
+  chdir $cwd;
+  $got_sterile = 1;
+}
+my $fixed_up;
+
+sub fixup_sterile {
+  return if $fixed_up;
+  get_sterile();
+  my $cwd = cwd();
+  chdir '/tmp/perl5-sterile';
+  safe_exec( 'bash', 'patch_fixlist.sh', '/home/travis/perl5/perlbrew/perls/' . $ENV{TRAVIS_PERL_VERSION} );
+  chdir $cwd;
+  $fixed_up = 1;
+}
+my $sterile_deployed;
+
+sub deploy_sterile {
+  return if $sterile_deployed;
+  fixup_sterile();
+  for my $key ( keys %Config ) {
+    next unless $key =~ /(lib|arch)exp$/;
+    my $value = $Config{$key};
+    next unless defined $value;
+    next unless length $value;
+    my $clean_path = '/tmp/perl5-sterile/' . $value;
+    if ( -e $clean_path and -f $clean_path ) {
+      diag("\e[31mRsyncing over $value\e[0m");
+      $clean_path =~ s{/?$}{/};
+      $value =~ s{/?$}{/};
+      safe_exec( 'rsync', '-avp', '--delete-delay', $clean_path, $value );
+    }
+  }
+}
+
 sub cpanm_fix {
   my (@params) = @_;
   get_fixes();
@@ -118,6 +166,7 @@ sub import {
   $caller_stash->{cpanm_fix}          = *cpanm_fix;
   $caller_stash->{parse_meta_json}    = *parse_meta_json;
   $caller_stash->{capture_stdout}     = *capture_stdout;
+  $caller_stash->{deploy_sterile}     = *deploy_sterile;
 }
 
 1;
diff --git a/sterilize_env.pl b/sterilize_env.pl
index eac8cd4..0d51e86 100644
--- a/sterilize_env.pl
+++ b/sterilize_env.pl
@@ -37,137 +37,9 @@ if ( not env_true('STERILIZE_ENV') ) {
   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.340202'],
-  },
-  '5.12' => {
-    remove => [
-      ( 'autobox.pm', 'TAP/Parser/SourceHandler.pm', 'TAP/Parser/SourceHandler/Executable.pm' ),
-      ( 'TAP/Parser/SourceHandler/File.pm', 'TAP/Parser/SourceHandler/Handle.pm', 'TAP/Parser/SourceHandler/Perl.pm' ),
-      ( 'TAP/Parser/SourceHandler/RawTAP.pm', 'CPAN/Meta/YAML.pm',    'JSON/PP.pm',           'JSON/PP/Boolean.pm' ),
-      ( 'Module/Metadata.pm',                 'Perl/OSType.pm',       'CPAN/Meta.pm',         'CPAN/Meta/Converter.pm' ),
-      ( 'CPAN/Meta/Feature.pm',               'CPAN/Meta/History.pm', 'CPAN/Meta/Prereqs.pm', 'CPAN/Meta/Spec.pm' ),
-      ( 'CPAN/Meta/Validator.pm',             'Version/Requirements.pm' ),
-      ('ExtUtils/Miniperl.pm'),
-    ],
-    install => [
-      'Module::Build~<=0.3603',    'ExtUtils::MakeMaker~<=6.56',   'Test::Harness~<=3.17',     'ExtUtils::Liblist~<=6.56',
-      'ExtUtils::Manifest~<=1.57', 'ExtUtils::Mkbootstrap~<=6.56', 'ExtUtils::MM_OS2~<=6.56',  'ExtUtils::MM_Unix~<=6.56',
-      'ExtUtils::MM_VMS~<=6.56',   'ExtUtils::Mksymlists~<=6.56',  'ExtUtils::testlib~<=6.56', 'ExtUtils::MM_Win32~<=6.56',
-      'File::Spec~<=3.3101',       'File::Spec::Mac~<=3.30',       'File::Spec::OS2~<=3.30',   'File::Spec::Unix~<=3.30',
-      'File::Spec::VMS~<=3.30',    'File::Spec::Win32~<=3.30',     'Data::Dumper~<=2.125',     'File::Spec::Functions~<=3.30',
-    ],
-  },
-};
-
 if ( not env_true('TRAVIS') ) {
   diag('Is not running under travis!');
   exit 1;
 }
 
-use Config;
-
-sub valid_libs {
-  return grep { defined and length and -e $_ }
-    map { $Config{$_} } @_;
-}
-
-my (@all_libs)  = valid_libs( grep { $_ =~ /(lib|arch)exp$/ } keys %Config );
-my (@site_libs) = valid_libs( grep { $_ =~ /site(lib|arch)exp$/ } keys %Config );
-
-my ($corelist_file)    = $corelists . '/' . $] . '.zsv';
-my ($skiplist_file)    = $corelists . '/' . $] . '_skip.zsv';
-my ($protectlist_file) = $corelists . '/' . $] . '_protect.zsv';
-
-my $skip    = {};
-my $protect = {};
-
-if ( -e $skiplist_file and -f $skiplist_file ) {
-  diag("\e[33m Reading skips from $skiplist_file\e[0m");
-  open my $fh, '<', $skiplist_file;
-  local $/ = "\0\n";
-  while ( my $line = <$fh> ) {
-    my ($module) = split /\0/, $line;
-    diag("\e[34m$module\e[0m");
-    $skip->{$module} = 1;
-  }
-}
-if ( -e $protectlist_file and -f $protectlist_file ) {
-  diag("\e[33m Reading protections from $protectlist_file\e[0m");
-  open my $fh, '<', $protectlist_file;
-  local $/ = "\0\n";
-  while ( my $line = <$fh> ) {
-    my ($file) = split /\0/, $line;
-    diag("\e[34m$file\e[0m");
-    $protect->{$file} = 1;
-  }
-}
-
-if ( -e $corelist_file and -f $corelist_file ) {
-  diag("\e[32m Found corelist file for this perl: $], sterilizing with\e[0m");
-  open my $fh, '<', $corelist_file;
-  local $/ = "\0\n";
-  while ( my $line = <$fh> ) {
-    my ( $module, $version ) = split /\0/, $line;
-    my $fn = $module;
-    $fn =~ s/::/\//g;
-    $fn .= '.pm';
-    $protect->{$fn} = 1;
-    next if $skip->{$module};
-    next if not defined $version or not length $version;
-    cpanm( '--skip-satisfied', '--dev', '--quiet', '--notest', '--no-man-pages', $module . '~<=' . $version );
-  }
-  diag("Removing Bad things from all Config paths");
-  for my $libdir (@site_libs) {
-    safe_exec( 'find', $libdir, '-type', 'f', '-delete' );
-    safe_exec( 'find', $libdir, '-depth', '-type', 'd', '-delete' );
-  }
-
-  for my $libdir (@all_libs) {
-    open my $finder, '-|', 'find', $libdir, '-type', 'f', '-print0';
-    local $/ = "\0";
-    while ( my $file = <$finder> ) {
-      require File::Spec;
-      my $rel = File::Spec->abs2rel( $file, $libdir );
-      if ( not exists $protect->{$rel} ) {
-        diag("\e[33m Unprotected, $rel\e[0m");
-        unlink $file;
-      }
-      else {
-        diag("\e[34m Protected, $rel\e[0m");
-      }
-    }
-  }
-  exit 0;
-}
-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};
-    for my $dep ( @{ $fixups->{install} } ) {
-      cpanm( '--skip-satisfied', '--dev', '--quiet', '--notest', '--no-man-pages', $dep );
-    }
-    if ( $fixups->{remove} ) {
-      diag("Removing Bad things from all Config paths");
-      for my $libdir (@all_libs) {
-        for my $removal ( @{ $fixups->{remove} } ) {
-          my $path = $libdir . '/' . $removal;
-          diag("\e[32m ? $path \e[0m");
-          if ( -e $path and -f $path ) {
-            unlink $path;
-            diag("Removed $path");
-          }
-        }
-      }
-    }
-  }
-}
-for my $libdir (@site_libs) {
-  safe_exec( 'find', $libdir, '-type', 'f', '-delete' );
-  safe_exec( 'find', $libdir, '-depth', '-type', 'd', '-delete' );
-}
+deploy_sterile();

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmoosex-has-sugar-perl.git



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