Skip to content

Commit ab9ce5b

Browse files
committed
add update-news.pl to update NEWS file from changelog.qgis.org
1 parent 90b2a2d commit ab9ce5b

File tree

2 files changed

+76
-1
lines changed

2 files changed

+76
-1
lines changed

scripts/release.pl

+4-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@ ($$)
153153
run( "scripts/create_changelog.sh", "create_changelog.sh failed" );
154154

155155
unless( $dopoint ) {
156-
run( "git commit -a -m \"changelog update for $release\"", "could not commit changelog update" );
156+
# 2.14 already there - skip it this time
157+
#run( "scripts/update-news.pl $newmajor $newminor '$release'" );
158+
159+
run( "git commit -a -m \"changelog and news update for $release\"", "could not commit changelog and news update" );
157160

158161
print "Creating and checking out branch...\n";
159162
run( "git checkout -b $relbranch", "git checkout release branch failed" );

scripts/update-news.pl

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
#!/usr/bin/perl
2+
# updates the news file from changelog.qgis.org
3+
4+
# Copyright (C) 2016 Jürgen E. Fischer <jef@norbit.de>
5+
6+
# This program is free software; you can redistribute it and/or modify
7+
# it under the terms of the GNU General Public License as published by
8+
# the Free Software Foundation; either version 2 of the License, or
9+
# (at your option) any later version.
10+
11+
use strict;
12+
use warnings;
13+
use Pod::Usage;
14+
use LWP::Simple;
15+
use File::Temp qw/tempfile/;
16+
use File::Copy qw/copy/;
17+
18+
pod2usage(1) if @ARGV!=3;
19+
20+
my ($major,$minor,$releasename) = @ARGV;
21+
22+
23+
my ($news,$tempfile) = tempfile();
24+
25+
open my $in, "doc/news.t2t";
26+
while(<$in>) {
27+
print $news $_;
28+
last if /^Last Change/;
29+
}
30+
31+
my $content = get("http://changelog.qgis.org/en/qgis/version/$major.$minor.0/gnu/" );
32+
die "Couldn't get it!" unless defined $content;
33+
34+
print $news "\n= What's new in Version $major.$minor '$releasename'? =\n\n";
35+
print $news "This release has following new features:\n\n";
36+
37+
for $_ (split /\n/, $content) {
38+
next if /^Changelog /;
39+
next if /^------/;
40+
next if /^\s*$/;
41+
42+
s/^&quot;/"/g;
43+
s/^\*\s+/- /;
44+
s/ : /: /;
45+
s/\s+$//;
46+
47+
print $news "$_\n";
48+
}
49+
50+
print $news "\n";
51+
52+
while(<$in>) {
53+
print $news $_;
54+
}
55+
56+
close $news;
57+
close $in;
58+
59+
copy($tempfile, "doc/news.t2t");
60+
61+
system "txt2tags -odoc/news.html -t html doc/news.t2t";
62+
system "txt2tags -oNEWS -t txt doc/news.t2t";
63+
64+
=head1 NAME
65+
66+
update-news.pl - updates the news file from changelog.qgis.org
67+
68+
=head1 SYNOPSIS
69+
70+
update-news.pl major minor releasename
71+
72+
=cut

0 commit comments

Comments
 (0)