Permalink
Browse files

Prepare for moving to perlbrew.

Perlbrew doesn't "just work" for me at the moment.  The patching process for
5.6.[12] produces dependencies on db3/db.h which doesn't exist on my system.
Hopefully it will work better soon and I can drop the buildperl code.
  • Loading branch information...
1 parent ff9538f commit a306074da31dd16550868c415b12419abbe617ce @pjcj committed Oct 13, 2011
Showing with 49 additions and 9 deletions.
  1. +49 −9 utils/all_versions
View
@@ -31,6 +31,7 @@ sub get_options
die "Bad option" unless
GetOptions($Options, # Store the options in the Options hash.
qw(
+ build!
dry_run!
ignore_failure!
silent!
@@ -42,14 +43,14 @@ sub get_options
5.8.0 5.8.1 5.8.2 5.8.3 5.8.4 5.8.5 5.8.6 5.8.7 5.8.8 5.8.9
5.10.0 5.10.1
5.12.0 5.12.1 5.12.2 5.12.3 5.12.4
- 5.14.0 5.14.1
- 5.15.0 5.15.1 5.15.2
+ 5.14.0 5.14.1 5.14.2
+ 5.15.0 5.15.1 5.15.2 5.15.3
) ]
unless @{$Options->{version}};
$Silent = " >/dev/null 2>&1" if $Options->{silent};
$Options->{version} =
- [ grep eval { !system "perl$_ -v$Silent" }, @{$Options->{version}} ];
- print "Testing against: @{$Options->{version}}\n";
+ [ grep eval { !system "perl$_ -v$Silent" }, @{$Options->{version}} ]
+ unless $Options->{build};
}
sub sys
@@ -62,18 +63,57 @@ sub sys
die "command failed: $?" if $ret && !$Options->{ignore_failure};
}
+sub build
+{
+ for my $v (@{$Options->{version}})
+ {
+ my $opts = "";
+ if ($v =~ /thr/)
+ {
+ $opts .= "-D usethreads --as perl-$v";
+ }
+ sys "perlbrew install -v $v $opts";
+ my @mods = qw( Storable Digest::MD5 Test::More Test::Warn );
+ if ($v !~ /thr/)
+ {
+ push @mods,
+ qw(
+ Template
+ PPI::HTML
+ Perl::Tidy
+ Pod::Coverage
+ Pod::Coverage::CountParents
+ Test::Differences
+ Parallel::Iterator
+ JSON::PP
+ );
+ my ($n) = $v =~ /(\d+)$/;
+ push @mods, "Perl::Tidy" if !$n || $n % 2;
+ push @mods, "PPI::HTML" if !$n || !($n % 2);
+ }
+ sys "perlbrew use $v && cpanm @mods";
+ }
+ exit
+}
+
get_options;
+build if $Options->{build};
+
my $command = "@ARGV" or die "Usage: $0 [-v version] command\n";
+print "Testing against: @{$Options->{version}}\n";
for my $v (@{$Options->{version}})
{
my $perl = "perl$v";
(my $c = $command) =~ s/=perl/$perl/g;
$c =~ s/=v/$v/g;
- sys "rm -rf t/e2e";
- sys "$perl Makefile.PL";
- sys "make clean";
- sys "$perl Makefile.PL";
- sys "make";
+ if ($c =~ /^make /)
+ {
+ sys "rm -rf t/e2e";
+ sys "$perl Makefile.PL";
+ sys "make clean";
+ sys "$perl Makefile.PL";
+ sys "make";
+ }
sys $c, 1;
}

0 comments on commit a306074

Please sign in to comment.