Module: tools Branch: master Commit: bfaa1e39cbbeceeb03e0f556ae018c4e3d427abe URL: https://source.winehq.org/git/tools.git/?a=commit;h=bfaa1e39cbbeceeb03e0f556...
Author: Alexandre Julliard julliard@winehq.org Date: Thu Jan 14 17:08:48 2021 +0100
update-winehq: Fix formatting of news item for major release.
Signed-off-by: Alexandre Julliard julliard@winehq.org
---
update-winehq | 71 +++++++++++++++++++++++------------------------------------ 1 file changed, 27 insertions(+), 44 deletions(-)
diff --git a/update-winehq b/update-winehq index 4ba11d4..9ea758d 100755 --- a/update-winehq +++ b/update-winehq @@ -33,9 +33,7 @@ system("git", "pull") == 0 or die "git pull failed"; # Parse the ANNOUNCE file
open ANNOUNCE, $ARGV[1] || "ANNOUNCE" or die "cannot open ANNOUNCE"; -my $whats_new = 0; -my $release_notes = 0; -my $first = 1; +my $ul = 0; my $url;
push @text, "<body>\n<p>"; @@ -43,52 +41,37 @@ push @text, "<body>\n<p>"; while (<ANNOUNCE>) { chomp; - if (!$whats_new && !$release_notes) + if (/^What's new in this release/) { - if (/^What's new in this release/) - { - $whats_new = 1; - push @text, " <a href="{$root}/announce/$rel">What's new</a> in this release:"; - next; - } - elsif (/See the release notes/) - { - $release_notes = 1; - xml_escape($_); - s/See the release notes/See the <a href="{$root}/announce/$rel">release notes</a>/; - push @text, " " . $_; - next; - } - if (/^\s*$/) - { - push @text, "</p>\n<p>"; - next; - } - last if (/^The source is available/); - last if (/^--------------------/); - push @text, " " . xml_escape($_); + push @text, " <a href="{$root}/announce/$rel">What's new</a> in this release:"; + next; } - else + elsif (/the release notes/) { - if (/^ *- (.*)$/) - { - push @text, ($first ? "\n<ul>\n <li>" : "</li>\n <li>") . xml_escape($1); - $first = 0; - next; - } - if (/^\s*$/) + xml_escape($_); + s/the release notes/the <a href="{$root}/announce/$rel">release notes</a>/; + push @text, " " . $_; + next; + } + if (/^\s*$/) + { + if ($ul) { - if ($release_notes) { - push @text, "</p>\n"; - } else { - push @text, "</li>\n</ul>\n"; - } - $whats_new = 0; - $release_notes = 0; - next; + push @text, "</li>\n</ul>\n"; + $ul = 0; } - push @text, " " . xml_escape($_); + push @text, "</p>\n<p>"; + next; + } + if (/^ *- (.*)$/) + { + push @text, (!$ul ? "\n<ul>\n <li>" : "</li>\n <li>") . xml_escape($1); + $ul = 1; + next; } + last if (/^The source is available/); + last if (/^--------------------/); + push @text, " " . xml_escape($_); }
while (<ANNOUNCE>) @@ -101,7 +84,7 @@ while (<ANNOUNCE>) } die "Download URL not found" unless $url;
-push @text, "<p>The source is <a href="$url">available now</a>.\n"; +push @text, "The source is <a href="$url">available now</a>.\n"; push @text, "Binary packages are in the process of being built, and will appear soon at their respective <a href="{$root}/download">download locations</a>.\n"; push @text, "</p></body></news>\n"; close ANNOUNCE;