Skip to content

Commit

Permalink
verify that projecta actually delivers a changelog
Browse files Browse the repository at this point in the history
(cherry picked from commit a826c56)
  • Loading branch information
jef-n committed Nov 1, 2018
1 parent bc8fe90 commit 2c04082
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 2 additions & 1 deletion scripts/release.pl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ ($$)
run( "perl -i -pe 's#<releases>#<releases>\n <release version=\"$newmajor.$newminor.$newpatch\" date=\"" . strftime("%Y-%m-%d", localtime) . "\" />#' linux/org.qgis.qgis.appdata.xml.in", "appdata update failed" );

unless( $dopoint ) {
run( "scripts/update-news.pl $newmajor $newminor '$newreleasename'", "could not update news" ) if $major>2 || ($major==2 && $minor>14);
my $v = ($doltr && ($major>3 || ($major==3 && $minor>=4))) ? "$newmajor.$newminor-LTR" : "$newmajor.$newminor.0";
run( "scripts/update-news.pl $v '$newreleasename'", "could not update news" ) if $major>2 || ($major==2 && $minor>14);

run( "git commit -n -a -m \"changelog and news update for $release\"", "could not commit changelog and news update" );

Expand Down
12 changes: 7 additions & 5 deletions scripts/update-news.pl
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
use File::Copy qw/copy/;
use HTML::Entities qw/decode_entities/;

pod2usage(1) if @ARGV!=3;
pod2usage(1) if @ARGV!=2;

my ($major,$minor,$releasename) = @ARGV;
my ($version,$releasename) = @ARGV;


my ($news,$tempfile) = tempfile();
Expand All @@ -28,12 +28,14 @@
last if /^Last Change/;
}

my $content = `curl -s http://changelog.qgis.org/en/qgis/version/$major.$minor.0/gnu/`;
my $content = `curl -s http://changelog.qgis.org/en/qgis/version/$version/gnu/`;
die "Couldn't get it!" unless defined $content;

print $news "\n= What's new in Version $major.$minor '$releasename'? =\n\n";
print $news "\n= What's new in Version $version '$releasename'? =\n\n";
print $news "This release has following new features:\n\n";

die "Invalid changelog" unless $content =~ /^Changelog for QGIS/;

for $_ (split /\n/, $content) {
next if /^Changelog /;
next if /^------/;
Expand Down Expand Up @@ -68,6 +70,6 @@ =head1 NAME
=head1 SYNOPSIS
update-news.pl major minor releasename
update-news.pl version releasename
=cut

0 comments on commit 2c04082

Please sign in to comment.