mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-17 00:04:02 -04:00
add update-news.pl to update NEWS file from changelog.qgis.org
This commit is contained in:
parent
90b2a2d907
commit
ab9ce5b4d9
@ -153,7 +153,10 @@ print "Updating changelog...\n";
|
||||
run( "scripts/create_changelog.sh", "create_changelog.sh failed" );
|
||||
|
||||
unless( $dopoint ) {
|
||||
run( "git commit -a -m \"changelog update for $release\"", "could not commit changelog update" );
|
||||
# 2.14 already there - skip it this time
|
||||
#run( "scripts/update-news.pl $newmajor $newminor '$release'" );
|
||||
|
||||
run( "git commit -a -m \"changelog and news update for $release\"", "could not commit changelog and news update" );
|
||||
|
||||
print "Creating and checking out branch...\n";
|
||||
run( "git checkout -b $relbranch", "git checkout release branch failed" );
|
||||
|
72
scripts/update-news.pl
Executable file
72
scripts/update-news.pl
Executable file
@ -0,0 +1,72 @@
|
||||
#!/usr/bin/perl
|
||||
# updates the news file from changelog.qgis.org
|
||||
|
||||
# Copyright (C) 2016 Jürgen E. Fischer <jef@norbit.de>
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Pod::Usage;
|
||||
use LWP::Simple;
|
||||
use File::Temp qw/tempfile/;
|
||||
use File::Copy qw/copy/;
|
||||
|
||||
pod2usage(1) if @ARGV!=3;
|
||||
|
||||
my ($major,$minor,$releasename) = @ARGV;
|
||||
|
||||
|
||||
my ($news,$tempfile) = tempfile();
|
||||
|
||||
open my $in, "doc/news.t2t";
|
||||
while(<$in>) {
|
||||
print $news $_;
|
||||
last if /^Last Change/;
|
||||
}
|
||||
|
||||
my $content = get("http://changelog.qgis.org/en/qgis/version/$major.$minor.0/gnu/" );
|
||||
die "Couldn't get it!" unless defined $content;
|
||||
|
||||
print $news "\n= What's new in Version $major.$minor '$releasename'? =\n\n";
|
||||
print $news "This release has following new features:\n\n";
|
||||
|
||||
for $_ (split /\n/, $content) {
|
||||
next if /^Changelog /;
|
||||
next if /^------/;
|
||||
next if /^\s*$/;
|
||||
|
||||
s/^"/"/g;
|
||||
s/^\*\s+/- /;
|
||||
s/ : /: /;
|
||||
s/\s+$//;
|
||||
|
||||
print $news "$_\n";
|
||||
}
|
||||
|
||||
print $news "\n";
|
||||
|
||||
while(<$in>) {
|
||||
print $news $_;
|
||||
}
|
||||
|
||||
close $news;
|
||||
close $in;
|
||||
|
||||
copy($tempfile, "doc/news.t2t");
|
||||
|
||||
system "txt2tags -odoc/news.html -t html doc/news.t2t";
|
||||
system "txt2tags -oNEWS -t txt doc/news.t2t";
|
||||
|
||||
=head1 NAME
|
||||
|
||||
update-news.pl - updates the news file from changelog.qgis.org
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
update-news.pl major minor releasename
|
||||
|
||||
=cut
|
Loading…
x
Reference in New Issue
Block a user