blob: 4a2e394cf1314763458ef4ae7688ff310b643790 [file] [log] [blame]
#!/usr/bin/perl -w
################################################################################
#
# mktodo -- generate baseline and todo files by running mktodo.pl
#
################################################################################
#
# $Revision: 18 $
# $Author: mhx $
# $Date: 2010/03/07 13:15:43 +0100 $
#
################################################################################
#
# Version 3.x, Copyright (C) 2004-2010, Marcus Holland-Moritz.
# Version 2.x, Copyright (C) 2001, Paul Marquess.
# Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
#
# This program is free software; you can redistribute it and/or
# modify it under the same terms as Perl itself.
#
################################################################################
use strict;
use Getopt::Long;
require 'devel/devtools.pl';
our %opt = (
base => 0,
check => 1,
verbose => 0,
install => '/tmp/perl/install/default',
blead => 'bleadperl',
);
GetOptions(\%opt, qw( base check! verbose install=s blead=s blead-version=s )) or die;
identify();
my $outdir = 'parts/todo';
my @perls = sort { $b->{version} <=> $a->{version} }
map { { version => `$_ -e 'printf "%.6f", \$]'`, path => $_ } }
($opt{blead}, glob "$opt{install}/*/bin/perl5.*");
if (exists $opt{'blead-version'}) {
$perls[0]{version} = $opt{'blead-version'};
}
for (1 .. $#perls) {
$perls[$_]{todo} = $perls[$_-1]{version};
}
shift @perls;
for (@perls) {
my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v };
-e "$outdir/$todo" and next;
my @args = ('--perl', $_->{path}, '--todo', "$outdir/$todo", '--version', "$_->{todo}");
push @args, '--base' if $opt{base};
push @args, '--verbose' if $opt{verbose};
push @args, '--nocheck' unless $opt{check};
runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";
}