-
Notifications
You must be signed in to change notification settings - Fork 89
/
mk-release-notes.pl
executable file
·72 lines (67 loc) · 1.62 KB
/
mk-release-notes.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
65
66
67
68
69
70
71
72
#!/usr/bin/perl
my @url;
my $prefix;
my @release;
while (<STDIN>) {
my $l = $_;
if( $_ =~ / \[(\d*)\] = (.*)/) {
$url[$1] = $2;
}
else {
push @release, $l;
}
}
my $mode; # 0 - normal, 1 - known bugs, 2 - References
my $contr;
foreach my $l (@release) {
$l =~ s/\/\*/\/*/g; # replace /*
$l =~ s/\*\//*\//g; # replace */
$l =~ s/\</</g; # replace <
$l =~ s/\>/>/g; # replace >
$l =~ s/\"/"/g; # replace "
$l =~ s/\'/'/g; # replace '
if($mode == 1 ) {
if($l =~ /^ ([^ \(].*)/) {
$contr .= "$1 ";
}
elsif($l =~ /^References/) {
$mode=2;
}
}
elsif($mode == 2) {
if( $l =~ / \[(\d*)\] = (.*)/) {
$url[$1] = 2;
}
}
elsif($l =~ /^Curl and libcurl (.*)/) {
print "SUBTITLE(Fixed in $1 - [not yet released])\n";
}
elsif($l =~ /^This release includes the following (.*):/) {
if($prefix) {
print "</ul>\n";
}
if($1 eq "known bugs") {
$mode = 1;
next;
}
if($1 eq "changes") {
$prefix = "CHG";
}
else {
$prefix = "BGF";
}
printf "<p> %s:\n<ul class=\"%s\">\n", ucfirst($1), $1;
}
else {
chomp $l;
if($l =~ / o (.*)\[(\d*)\]/) {
my ($text, $num)=($1, $2);
$text =~ s/ +$//;
printf " $prefix <a href=\"%s\">%s</a>\n", $url[$num], $text;
}
elsif($l =~ / o (.*)/) {
printf " $prefix %s\n", $1;
}
}
}
print "<p> Contributors:<p> $contr\n";