summaryrefslogtreecommitdiff
path: root/dist/Devel-PPPort/devel/mktodo
blob: 800a7cc4687559d88f3d02291f27e2d8f39d6624 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/usr/bin/perl -w
################################################################################
#
#  mktodo -- generate baseline and todo files by running mktodo.pl
#
# It calls plain 'mktodo' on each perl version it finds based on the input
# parameters.
#
################################################################################
#
#  Version 3.x, Copyright (C) 2004-2013, 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,     # If specified, this will generate base files, not todo ones
  check   => 1,     # Do extra checking
  verbose => 0,
  install => '/tmp/perl/install/default',
  blead   => 'bleadperl-debug',
  debug   => 0,
 'debug-start' => "",   # build an incomplete output, starting with the
                        # specified perl of the form perl5.xxxyyy
);

# The way this works, is it expects to find perl binaries for a bunch of
# different versions in a given directory.  This defaults to the 'install' one
# listed above, but is overriddable by the --install parameter.  Comma
# separating --install allows multiple source directories.
# It also uses blead, again with an overridable default.
#
# It first verifies that the test file works properly for blead.
#
# Then it goes through the list of perl binaries sorted in decreasing order of
# version number.  If something works in version n, but not in version n-1,
# that means it was introduced (or perhaps fixed) in version n, and adds that
# thing to the version n list.
#
# After everything is done, we have lists of what got added when.  The --base
# parameter tells it to not use ppport.h when computing this.  Thus we get
# what the official perls added when.  Without this parameter, we do use
# ppport.h, so we get, as patched by ppport.h, what gets added when

GetOptions(\%opt, qw( base check! verbose install=s blead=s blead-version=s
                      debug debug-start=s)) or die;

identify();

my $outdir = 'parts/todo';

my $perls_ref = get_and_sort_perls(\%opt);

# Go through all the perls, creating a todo file for it.
for (@${perls_ref}) {
  my $todo = do { my $v = $_->{todo}; $v =~ s/\D+//g; $v };
  my @args = ('--perl', $_->{path}, '--version', "$_->{todo}");

  push @args, '--blead' if $_ == $perls_ref->[0];   # First one is blead
  push @args, '--todo', $_->{'todo'};
  push @args, '--base' if $opt{base};
  push @args, '--debug' if $opt{debug};
  push @args, '--verbose' if $opt{verbose};
  push @args, '--nocheck' unless $opt{check};
  runperl('devel/mktodo.pl', @args) or die "error running mktodo.pl [$!] [$?]\n";
}