-
Notifications
You must be signed in to change notification settings - Fork 138
/
pmcrenumber.pl
executable file
·64 lines (42 loc) · 1.06 KB
/
pmcrenumber.pl
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
#! perl
# Copyright (C) 2009, Parrot Foundation.
use strict;
use warnings;
my $pmc_num_file = $ARGV[0];
my $pmc_order = 0;
my $pmc_num_contents;
open my $pmc_num_fh, '<', $pmc_num_file;
for (<$pmc_num_fh>) {
if (/^([\w]+)\.pmc\s+\d+$/) {
$pmc_num_contents .= "$1.pmc $pmc_order\n";
$pmc_order++;
}
else {
$pmc_num_contents .= $_;
}
}
close $pmc_num_fh;
open $pmc_num_fh, '>', $pmc_num_file;
print $pmc_num_fh $pmc_num_contents;
close $pmc_num_fh;
################### DOCUMENTATION ####################
=head1 NAME
tools/dev/pmcrenumber.pl - Renumber F<src/pmc/pmc.num>.
=head1 SYNOPSIS
$ perl tools/dev/pmcrenumber.pl pmc.num
=head1 DESCRIPTION
This program should be used when adding PMCs. Note that it does not remove
numbers assigned to PMCs that have been removed; this happens very rarely.
=head1 SEE ALSO
=over 4
=item F<lib/Parrot/OpsRenumber.pm>.
=back
=head1 AUTHOR
Christoph Otto
=cut
# Local Variables:
# mode: cperl
# cperl-indent-level: 4
# fill-column: 100
# End:
# vim: expandtab shiftwidth=4: