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
CommitLineData
adfe19db
MHM
1#!/usr/bin/perl -w
2################################################################################
3#
4# mktodo -- generate baseline and todo files by running mktodo.pl
5#
6################################################################################
7#
b2049988 8# Version 3.x, Copyright (C) 2004-2013, Marcus Holland-Moritz.
adfe19db
MHM
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
17use strict;
18use Getopt::Long;
19
3d7c117d 20require './devel/devtools.pl';
0c96388f
MHM
21
22our %opt = (
23 base => 0,
ba120f6f 24 check => 1,
0c96388f 25 verbose => 0,
49ef49fe 26 install => '/tmp/perl/install/default',
b2049988 27 blead => 'bleadperl-debug',
adfe19db
MHM
28);
29
49ef49fe 30GetOptions(\%opt, qw( base check! verbose install=s blead=s blead-version=s )) or die;
adfe19db 31
0c96388f
MHM
32identify();
33
adfe19db
MHM
34my $outdir = 'parts/todo';
35
adfe19db
MHM
36my @perls = sort { $b->{version} <=> $a->{version} }
37 map { { version => `$_ -e 'printf "%.6f", \$]'`, path => $_ } }
60474171 38 ($opt{blead}, grep !/-RC\d+/, glob "$opt{install}/bin/perl5.*");
49ef49fe
CBW
39
40if (exists $opt{'blead-version'}) {
41 $perls[0]{version} = $opt{'blead-version'};
42}
adfe19db
MHM
43
44for (1 .. $#perls) {
45 $perls[$_]{todo} = $perls[$_-1]{version};
46}
47
48shift @perls;
49
50for (@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};
0c96388f 55 push @args, '--verbose' if $opt{verbose};
ba120f6f 56 push @args, '--nocheck' unless $opt{check};
0c96388f 57 runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";
adfe19db 58}