Apache Solr open-source search software
LUCENE-4944: Prepend 'v' to (currently numeric) id attributes for release sections, and fail with a nice message when encountering the same section more than once within a single release.
Steven Rowef72566273c48
diff --git a/lucene/site/changes/changes2html.pl b/lucene/site/changes/changes2html.plindex 0279750250b..2c72f45bf2e 100755--- a/lucene/site/changes/changes2html.pl+++ b/lucene/site/changes/changes2html.pl@@ -78,9 +78,9 @@ for (my $line_num = 0 ; $line_num <= $#lines ; ++$line_num) {($reldate, $relinfo) = get_release_date($release, $relinfo);$sections = [];push @releases, [ $release, $reldate, $relinfo, $sections ];- ($first_relid = lc($release)) =~ s/\s+/_/g+ ($first_relid = 'v'.lc($release)) =~ s/\s+/_/gif ($#releases == 0 or ($#releases == 1 and not ($releases[0][0])));- ($second_relid = lc($release)) =~ s/\s+/_/g+ ($second_relid = 'v'.lc($release)) =~ s/\s+/_/gif ( ($#releases == 1 and $releases[0][0])or ($#releases == 2 and not $releases[0][0]));$items = undef;@@ -123,6 +123,11 @@ for (my $line_num = 0 ; $line_num <= $#lines ; ++$line_num) {# Make a fake release to hold pre-release sectionspush @releases, [ undef, undef, undef, $sections ];}+ for my $section (@$sections) {+ if ($heading eq $section->[0]) {+ die "Section '$heading' appears more than once under release '$releases[-1][0]'";+ }+ }push @$sections, [ $heading, $items ];$in_major_component_versions_section= ($heading =~ /Versions of Major Components/i);@@ -416,7 +421,7 @@ for my $rel (@releases) {my $relid = '';if ($release) { # Pre-release sections have no release ID++$relcnt;- ($relid = lc($release)) =~ s/\s+/_/g;+ ($relid = 'v'.lc($release)) =~ s/\s+/_/g;print "<$header>";print "<a id=\"$relid\" href=\"javascript:toggleList('$relid')\">"unless ($release =~ /^20\d\d/);