10 my ( $help, $type, $html );
19 make-rmg-checklist [--type TYPE]
21 This script creates a release checklist as a simple HTML document. It accepts
22 the following arguments:
24 --type The release type for the checklist. This can be BLEAD-FINAL,
25 BLEAD-POINT, MAINT, or RC. This defaults to BLEAD-POINT.
27 --html Output HTML instead of POD
34 $type = _validate_type($type);
36 open my $fh, '<', 'Porting/release_managers_guide.pod';
37 my $pod = do { local $/; <$fh> };
40 my $heads = _parse_rmg( $pod, $type );
41 my $new_pod = _munge_pod( $pod, $heads );
44 my $simple = Pod::Simple::HTML->new();
45 $simple->output_fh(*STDOUT);
46 $simple->parse_string_document($new_pod);
54 my $type = shift || 'BLEAD-POINT';
56 my @valid = qw( BLEAD-FINAL BLEAD-POINT MAINT RC );
57 my %valid = map { $_ => 1 } @valid;
59 unless ( $valid{ uc $type } ) {
61 = "The type you provided ($type) is not a valid release type. It must be one of ";
62 $err .= join ', ', @valid;
79 for ( split /\n/, $pod ) {
80 if (/^=for checklist begin/) {
87 last if /^=for checklist end/;
89 if (/^=for checklist skip (.+)/) {
90 %skip = map { $_ => 1 } split / /, $1;
94 if (/^=head(\d) (.+)/) {
95 unless ( keys %skip && $skip{$type} ) {
96 push @heads, [ $1, $2 ];
110 $pod =~ s/=head1 NAME.+?(=head1 SYNOPSIS)/$1/s;
112 my $new_pod = <<'EOF';
115 Release Manager's Guide with Checklist
122 for my $head ( @{$heads} ) {
123 my $level = $head->[0] - 1;
125 if ( $level > $last_level ) {
126 $new_pod .= '=over ' . $level * 4;
129 elsif ( $level < $last_level ) {
130 $new_pod .= "=back\n\n" for 1 .. ( $last_level - $level );
133 $new_pod .= '=item * ' . 'L<< /' . $head->[1] . " >>\n\n";
135 $last_level = $level;
138 $new_pod .= "=back\n\n" while $last_level--;