53
53
my $dominor ;
54
54
my $dopoint ;
55
55
my $doltr = 0;
56
+ my $dopremajor = 0;
57
+ my $skipts = 0;
56
58
57
59
my $result = GetOptions(
58
60
" major" => \$domajor ,
62
64
" help" => \$help ,
63
65
" ltr" => \$doltr ,
64
66
" dryrun" => \$dryrun ,
67
+ " premajor" => \$dopremajor ,
68
+ " skipts" => \$skipts ,
65
69
);
66
70
67
71
pod2usage(1) if $help ;
73
77
pod2usage(" Exactly one of -major, -minor or -point expected" ) if $i !=1;
74
78
pod2usage(" Release name for major and minor releases expected" ) if !$dopoint && !defined $newreleasename ;
75
79
pod2usage(" Long term releases only for major and minor releases" ) if $doltr && $dopoint ;
80
+ pod2usage(" Pre-major releases can only be minor releases" ) if $dopremajor && !$dominor ;
76
81
pod2usage(" No CMakeLists.txt in current directory" ) unless -r " CMakeLists.txt" ;
77
82
78
83
my $major ;
@@ -96,11 +101,11 @@ ($$)
96
101
my $branch = ` git rev-parse --abbrev-ref HEAD 2>/dev/null` ;
97
102
$branch =~ s /\s +$// ;
98
103
pod2usage(" Not on a branch" ) unless $branch ;
99
- pod2usage(" Current branch is $branch . master or a release branch expected" ) if $branch !~ / ^(master|release-(\d +)_(\d +))$ / ;
104
+ pod2usage(" Current branch is $branch . master or a release branch expected" ) if $branch !~ / ^(master.* |release-(\d +)_(\d +))$ / ;
100
105
pod2usage(" Version mismatch ($2 .$3 in branch $branch vs. $major .$minor in CMakeLists.txt)" ) if $branch ne " master" && ( $major != $2 || $minor != $3 );
101
106
pod2usage(" Release name Master expected on master branch" ) if $branch eq " master" && $releasename ne " Master" ;
102
107
103
- if ( $branch eq " master" ) {
108
+ if ( $branch =~ / ^ master.* / ) {
104
109
pod2usage(" No point releases on master branch" ) if $dopoint ;
105
110
pod2usage(" No new release name for major/minor release" ) unless $newreleasename || $newreleasename eq $releasename ;
106
111
} else {
@@ -146,17 +151,21 @@ ($$)
146
151
my $reltag = " final-${newmajor} _${newminor} _${newpatch} " ;
147
152
148
153
unless ( $dopoint ) {
149
- print " Pulling transifex translations...\n " ;
150
- run( " scripts/pull_ts.sh" , " pull_ts.sh failed" );
151
- run( " git add i18n/*.ts" , " adding translations failed" );
152
- run( " git commit -a -m \" translation update for $release from transifex\" " , " could not commit translation updates" );
154
+ unless ( $skipts ) {
155
+ print " Pulling transifex translations...\n " ;
156
+ run( " scripts/pull_ts.sh" , " pull_ts.sh failed" );
157
+ run( " git add i18n/*.ts" , " adding translations failed" );
158
+ run( " git commit -a -m \" translation update for $release from transifex\" " , " could not commit translation updates" );
159
+ } else {
160
+ print " TRANSIFEX UPDATE SKIPPED!\n " ;
161
+ }
153
162
}
154
163
155
164
print " Updating changelog...\n " ;
156
165
run( " scripts/create_changelog.sh" , " create_changelog.sh failed" );
157
166
158
167
unless ( $dopoint ) {
159
- run( " scripts/update-news.pl $newmajor $newminor '$release '" , " could not update news" ) if $major >2 || ($major ==2 && $minor >14);
168
+ run( " scripts/update-news.pl $newmajor $newminor '$newreleasename '" , " could not update news" ) if $major >2 || ($major ==2 && $minor >14);
160
169
161
170
run( " git commit -a -m \" changelog and news update for $release \" " , " could not commit changelog and news update" );
162
171
@@ -193,23 +202,44 @@ ($$)
193
202
run( " git archive --format tar --prefix=qgis-$version / $reltag | bzip2 -c >qgis-$version .tar.bz2" , " git archive failed" );
194
203
run( " md5sum qgis-$version .tar.bz2 >qgis-$version .tar.bz2.md5" , " md5sum failed" );
195
204
205
+ my @topush ;
196
206
unless ( $dopoint ) {
197
207
$newminor ++;
198
208
199
209
print " Updating master...\n " ;
200
210
run( " git checkout master" , " checkout master failed" );
211
+
212
+ if ($dopremajor ) {
213
+ print " Creating master_$newmajor ...\n " ;
214
+ run( " git checkout -b master_$newmajor " , " checkout master_$newmajor failed" );
215
+ updateCMakeLists($newmajor ,$newminor ,0," Master" );
216
+ run( " cp /tmp/changelog debian" , " restore changelog failed" );
217
+ run( " dch -r ''" , " dch failed" );
218
+ run( " dch --newversion $newmajor .$newminor .0 'New development version $newmajor .$newminor after branch of $release '" , " dch failed" );
219
+ run( " git commit -a -m 'New development branch for interim $newmajor .x releases'" , " bump version failed" );
220
+
221
+ push @topush , " master_$newmajor " ;
222
+
223
+ run( " git checkout master" , " checkout master failed" );
224
+ $newminor =999;
225
+ }
226
+
201
227
updateCMakeLists($newmajor ,$newminor ,0," Master" );
202
228
run( " cp /tmp/changelog debian" , " restore changelog failed" );
203
229
run( " dch -r ''" , " dch failed" );
204
230
run( " dch --newversion $newmajor .$newminor .0 'New development version $newmajor .$newminor after branch of $release '" , " dch failed" );
205
231
run( " git commit -a -m 'Bump version to $newmajor .$newminor '" , " bump version failed" );
232
+
233
+ push @topush , " master" ;
206
234
}
207
235
208
- my $topush = ($dopoint ? " " : " master " ) . " $relbranch " ;
236
+ push @topush , $relbranch ;
237
+ my $topush = join (" " , @topush );
209
238
210
239
print " Push dry-run...\n " ;
211
240
run( " git push -n --follow-tags origin $topush " , " push dry run failed" );
212
241
print " Now manually push and upload the tarballs :\n\t git push --follow-tags origin $topush \n\t rsync qgis-$version .tar.bz2* qgis.org:/var/www/downloads/\n\n " ;
242
+ print " WARNING: TRANSIFEX UPDATE SKIPPED!\n " if $skipts ;
213
243
214
244
215
245
=head1 NAME
@@ -218,7 +248,7 @@ =head1 NAME
218
248
219
249
=head1 SYNOPSIS
220
250
221
- release.pl {{-major|-minor} [-ltr ] -releasename=releasename|-point}
251
+ release.pl {{-major|-minor [-premajor] } [-skipts ] -releasename=releasename|-point} [-ltr]
222
252
223
253
Options:
224
254
-major do a new major release
@@ -227,8 +257,17 @@ =head1 SYNOPSIS
227
257
-releasename=name new release name for master/minor release
228
258
-ltr new release is a long term release
229
259
-dryrun just echo but don't run any commands
260
+ -skipts skip transifex update
261
+ -premajor branch off a second "master" branch before
262
+ a major release
230
263
231
264
Major and minor releases also require a new splash screen
232
265
images/splash/splash-M.N.png and bitmap for the NSIS
233
266
installer ms-windows/Installer-Files/WelcomeFinishPage-M.N.bmp.
267
+
268
+ A pre-major minor release also produces a second branch
269
+ master_$currentmajor to allow more interim minor releases
270
+ while the new major version is being developed in master.
271
+ For that the minor version of the master branch leading
272
+ to the next major release is bumped to 999.
234
273
=cut
0 commit comments