This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
devel/mktodo: Fix location of old perls
[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 for (1 .. $#perls) {
45   $perls[$_]{todo} = $perls[$_-1]{version};
46 }
47
48 shift @perls;
49
50 for (@perls) {
51   my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v };
52   -e "$outdir/$todo" and next;
53   my @args = ('--perl', $_->{path}, '--todo', "$outdir/$todo", '--version', "$_->{todo}");
54   push @args, '--base' if $opt{base};
55   push @args, '--verbose' if $opt{verbose};
56   push @args, '--nocheck' unless $opt{check};
57   runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";
58 }