This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
devel/mktodo: Notify user of blead compilation issues
[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 43
ac18778d
KW
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;
adfe19db
MHM
47for (1 .. $#perls) {
48 $perls[$_]{todo} = $perls[$_-1]{version};
49}
50
adfe19db
MHM
51for (@perls) {
52 my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v };
53 -e "$outdir/$todo" and next;
ac18778d
KW
54 my @args = ('--perl', $_->{path}, '--version', "$_->{todo}");
55
56 push @args, '--blead' if $_ == $perls[0]; # First one is blead
57 push @args, '--todo', $_->{'todo'};
adfe19db 58 push @args, '--base' if $opt{base};
0c96388f 59 push @args, '--verbose' if $opt{verbose};
ba120f6f 60 push @args, '--nocheck' unless $opt{check};
0c96388f 61 runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";
adfe19db 62}