This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
e7014f075512e62e94f22ab81af40946d5121efb
[perl5.git] / dist / Devel-PPPort / devel / mktodo
1 #!/usr/bin/perl -w
2 ################################################################################
3 #
4 #  mktodo -- generate baseline and todo files by running mktodo.pl
5 #
6 ################################################################################
7 #
8 #  Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
9 #  Version 2.x, Copyright (C) 2001, Paul Marquess.
10 #  Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
11 #
12 #  This program is free software; you can redistribute it and/or
13 #  modify it under the same terms as Perl itself.
14 #
15 ################################################################################
16
17 use strict;
18 use Getopt::Long;
19
20 require './devel/devtools.pl';
21
22 our %opt = (
23   base    => 0,
24   check   => 1,
25   verbose => 0,
26   install => '/tmp/perl/install/default',
27   blead   => 'bleadperl-debug',
28 );
29
30 GetOptions(\%opt, qw( base check! verbose install=s blead=s blead-version=s )) or die;
31
32 identify();
33
34 my $outdir = 'parts/todo';
35
36 my @perls = sort { $b->{version} <=> $a->{version} }
37             map { { version => `$_ -e 'printf "%.6f", \$]'`, path => $_ } }
38             ($opt{blead}, grep !/-RC\d+/, glob "$opt{install}/bin/perl5.*");
39
40 if (exists $opt{'blead-version'}) {
41   $perls[0]{version} = $opt{'blead-version'};
42 }
43
44 # blead's todo is its version plus 1.  Otherwise, each todo is the previous
45 # one's version
46 $perls[0]{todo} = $perls[0]{version} + 1;
47 for (1 .. $#perls) {
48   $perls[$_]{todo} = $perls[$_-1]{version};
49 }
50
51 for (@perls) {
52   my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v };
53   -e "$outdir/$todo" and next;
54   my @args = ('--perl', $_->{path}, '--version', "$_->{todo}");
55
56   push @args, '--blead' if $_ == $perls[0]; # First one is blead
57   push @args, '--todo', $_->{'todo'};
58   push @args, '--base' if $opt{base};
59   push @args, '--verbose' if $opt{verbose};
60   push @args, '--nocheck' unless $opt{check};
61   runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";
62 }