Skip to content
Permalink
Browse files

release.pl: allow specifying explicit point release number

  • Loading branch information
jef-n committed May 17, 2020
1 parent c4546ae commit db50e777412515a5ab9a5f0d6682d7412a3c8faf
Showing with 14 additions and 13 deletions.
  1. +14 −13 scripts/release.pl
@@ -60,7 +60,7 @@ ($$)
my $result = GetOptions(
"major" => \$domajor,
"minor" => \$dominor,
"point" => \$dopoint,
"point:i" => \$dopoint,
"releasename=s" => \$newreleasename,
"help" => \$help,
"ltr" => \$doltr,
@@ -76,7 +76,7 @@ ($$)
$i++ if defined $dominor;
$i++ if defined $dopoint;
pod2usage("Exactly one of -major, -minor or -point expected") if $i!=1;
pod2usage("Release name for major and minor releases expected") if !$dopoint && !defined $newreleasename;
pod2usage("Release name for major and minor releases expected") if !defined $dopoint && !defined $newreleasename;
pod2usage("Pre-major releases can only be minor releases") if $dopremajor && !$dominor;
pod2usage("No CMakeLists.txt in current directory") unless -r "CMakeLists.txt";

@@ -106,10 +106,10 @@ ($$)
pod2usage("Release name Master expected on master branch" ) if $branch =~ /^master/ && $releasename ne "Master";

if( $branch =~ /^master.*/ ) {
pod2usage("No point releases on master branch") if $dopoint;
pod2usage("No point releases on master branch") if defined $dopoint;
pod2usage("No new release name for major/minor release") unless $newreleasename || $newreleasename eq $releasename;
} else {
pod2usage("Only point releases on release branches") if !$dopoint;
pod2usage("Only point releases on release branches") if !defined $dopoint;
pod2usage("New release names only for new minor releases") if $newreleasename;
$newreleasename = $releasename;
}
@@ -125,16 +125,17 @@ ($$)
$newmajor = $major;
$newminor = $minor + 1;
$newpatch = 0;
} elsif( $dopoint ) {
} elsif( defined $dopoint ) {
$newmajor = $major;
$newminor = $minor;
$newpatch = $patch + 1;
pod2usage("Given point release number <= $patch") if $dopoint && $dopoint <= $patch;
$newpatch = $dopoint ? $dopoint : $patch + 1;
} else {
pod2usage("No version change");
}

my $splashwidth;
unless( $dopoint ) {
unless( defined $dopoint ) {
pod2usage("Splash images/splash/splash-$newmajor.$newminor.png not found") unless -r "images/splash/splash-$newmajor.$newminor.png";
pod2usage("NSIS image ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.png not found") unless -r "ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.png";
my $welcomeformat = `identify -format '%wx%h %m' ms-windows/Installer-Files/WelcomeFinishPage-$newmajor.$newminor.png`;
@@ -163,7 +164,7 @@ ($$)
run( "scripts/create_changelog.sh", "create_changelog.sh failed" );
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 ) {
unless( defined $dopoint ) {
run( "scripts/update_news.pl $newmajor.$newminor '$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" );
@@ -179,7 +180,7 @@ ($$)
run( "dch --newversion $version 'Release of $version'", "dch failed" );
run( "cp debian/changelog /tmp", "backup changelog failed" );

unless( $dopoint ) {
unless( defined $dopoint ) {
run( "perl -i -pe 's/qgis-dev-deps/qgis-ltr-deps/;' doc/msvc.t2t", "could not update osgeo4w deps package" ) if $doltr;
run( "perl -i -pe 's/qgis-dev-deps/qgis-rel-deps/;' doc/msvc.t2t", "could not update osgeo4w deps package" ) unless $doltr;
run( "txt2tags -odoc/INSTALL.html -t html doc/INSTALL.t2t", "could not update INSTALL.html" );
@@ -201,7 +202,7 @@ ($$)
run( "sha256sum qgis-$version.tar.bz2 >qgis-$version.tar.bz2.sha256", "sha256sum failed" );

my @topush;
unless( $dopoint ) {
unless( defined $dopoint ) {
$newminor++;

print "Updating master...\n";
@@ -246,12 +247,12 @@ =head1 NAME
=head1 SYNOPSIS
release.pl {{-major|-minor [-premajor]} [-skipts] -releasename=releasename|-point} [-ltr]
release.pl {{-major|-minor [-premajor]} [-skipts] -releasename=releasename|-point[=version]} [-ltr]
Options:
-major do a new major release
-minor do a new minor release
-point do a new point release
-point[=number] do a new point release with an optional number
-releasename=name new release name for master/minor release
-ltr new release is a long term release
-dryrun just echo but don't run any commands
@@ -267,5 +268,5 @@ =head1 SYNOPSIS
master_$currentmajor to allow more interim minor releases
while the new major version is being developed in master.
For that the minor version of the master branch leading
to the next major release is bumped to 999.
to the next major release is bumped to 99.
=cut

0 comments on commit db50e77

Please sign in to comment.
You can’t perform that action at this time.