my @targets
= qw(config.sh config.h miniperl lib/Config.pm Fcntl perl test_prep);
-my $cpus;
-if (open my $fh, '<', '/proc/cpuinfo') {
- while (<$fh>) {
- ++$cpus if /^processor\s+:\s+\d+$/;
- }
-} elsif (-x '/sbin/sysctl') {
- $cpus = 1 + $1 if `/sbin/sysctl hw.ncpu` =~ /^hw\.ncpu: (\d+)$/;
-} elsif (-x '/usr/bin/getconf') {
- $cpus = 1 + $1 if `/usr/bin/getconf _NPROCESSORS_ONLN` =~ /^(\d+)$/;
-}
-
my %options =
(
- jobs => defined $cpus ? $cpus + 1 : 2,
'expect-pass' => 1,
clean => 1, # mostly for debugging this
);
pod2usage(exitval => 255, verbose => 1);
}
-my ($target, $j, $match) = @options{qw(target jobs match)};
+my ($target, $match) = @options{qw(target match)};
@ARGV = ('sh', '-c', 'cd t && ./perl TEST base/*.t')
if $options{validate} && !@ARGV;
$defines{cc} = (`ccache -V`, $?) ? 'cc' : 'ccache cc';
}
-$j = "-j$j" if $j =~ /\A\d+\z/;
+my $j = $options{jobs} ? "-j$options{jobs}" : '';
if (exists $options{make}) {
if (!exists $defines{make}) {
# Which isn't what we want.
use Getopt::Long qw(:config pass_through no_auto_abbrev);
-my ($start, $end, $validate, $usage, $bad);
-$bad = !GetOptions('start=s' => \$start, 'end=s' => \$end,
+my ($start, $end, $validate, $usage, $bad, $jobs);
+$bad = !GetOptions('start=s' => \$start, 'end=s' => \$end, 'jobs|j=i' => \$jobs,
validate => \$validate, 'usage|help|?' => \$usage);
unshift @ARGV, '--help' if $bad || $usage;
unshift @ARGV, '--validate' if $validate;
my $start_time = time;
+if (!defined $jobs) {
+ # Try to default to (ab)use all the CPUs:
+ my $cpus;
+ if (open my $fh, '<', '/proc/cpuinfo') {
+ while (<$fh>) {
+ ++$cpus if /^processor\s+:\s+\d+$/;
+ }
+ } elsif (-x '/sbin/sysctl') {
+ $cpus = $1 if `/sbin/sysctl hw.ncpu` =~ /^hw\.ncpu: (\d+)$/;
+ } elsif (-x '/usr/bin/getconf') {
+ $cpus = $1 if `/usr/bin/getconf _NPROCESSORS_ONLN` =~ /^(\d+)$/;
+ }
+ $jobs = defined $cpus ? $cpus + 1 : 2;
+}
+
+unshift @ARGV, '--jobs', $jobs;
+
# We try these in this order for the start revision if none is specified.
my @stable = qw(perl-5.005 perl-5.6.0 perl-5.8.0 v5.10.0 v5.12.0 v5.14.0);