2 ################################################################################
4 # mktodo -- generate baseline and todo files by running mktodo.pl
6 # It calls plain 'mktodo' on each perl version it finds based on the input
9 ################################################################################
11 # Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
12 # Version 2.x, Copyright (C) 2001, Paul Marquess.
13 # Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
15 # This program is free software; you can redistribute it and/or
16 # modify it under the same terms as Perl itself.
18 ################################################################################
23 require './devel/devtools.pl';
26 base => 0, # If specified, this will generate base files, not todo ones
27 check => 1, # Do extra checking
29 install => '/tmp/perl/install/default',
30 blead => 'bleadperl-debug',
33 # The way this works, is it expects to find perl binaries for a bunch of
34 # different versions in a given directory. This defaults to the 'install' one
35 # listed above, but is overriddable by the --install parameter. It also uses
36 # blead, again with an overridable default.
38 # It first verifies that the test file works properly for blead.
40 # Then it goes through the list of perl binaries sorted in decreasing order of
41 # version number. If something works in version n, but not in version n-1,
42 # that means it was introduced (or perhaps fixed) in version n, and adds that
43 # thing to the version n list.
45 # After everything is done, we have lists of what got added when. The --base
46 # parameter tells it to not use ppport.h when computing this. Thus we get
47 # what the official perls added when. Without this parameter, we do use
48 # ppport.h, so we get, as patched by ppport.h, what gets added when
50 GetOptions(\%opt, qw( base check! verbose install=s blead=s blead-version=s )) or die;
54 my $outdir = 'parts/todo';
56 my @perls = sort { $b->{version} <=> $a->{version} }
57 map { { version => `$_ -e 'printf "%.6f", \$]'`, path => $_ } }
58 ($opt{blead}, grep !/-RC\d+/, glob "$opt{install}/bin/perl5.*");
60 if (exists $opt{'blead-version'}) {
61 $perls[0]{version} = $opt{'blead-version'};
64 # blead's todo is its version plus 1. Otherwise, each todo is the previous
66 $perls[0]{todo} = $perls[0]{version} + 1;
68 $perls[$_]{todo} = $perls[$_-1]{version};
72 my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v };
73 -e "$outdir/$todo" and next;
74 my @args = ('--perl', $_->{path}, '--version', "$_->{todo}");
76 push @args, '--blead' if $_ == $perls[0]; # First one is blead
77 push @args, '--todo', $_->{'todo'};
78 push @args, '--base' if $opt{base};
79 push @args, '--verbose' if $opt{verbose};
80 push @args, '--nocheck' unless $opt{check};
81 runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";